I defined the ink! method and struct like this:
#[derive(SpreadAllocate, PackedLayout, SpreadLayout, Clone, Decode, Encode)]
#[cfg_attr(feature = "std", derive(Debug, scale_info::TypeInfo, StorageLayout))]
pub struct ShowTest{
test_id: u8,
}
//...
#[ink(message)]
pub fn show_test_add(&mut self, v: ShowTest) {
}
After I deployed the contract to the local contract-test chain, I found the method name show_test_add
became showTestAdd
and field name test_id
became testId
.
And it was the same when I used polkadot api in JS, I don't know why.