You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[ink(message)]pubfndeploy(&mutself,version:u32,code_hash:Hash){let _ = Subcontract::new(b).endowment(self.env().balance() / 4).code_hash(code_hash).salt_bytes(version.to_le_bytes()).instantiate().expect("failed at instantiating);}
Then calling this method will fail at runtime with ContractTrapped. This is because the payable attribute is missing, the message signature should be #[ink(message, payable)].
In an ideal world we would detect this already at compile time, though I'm not sure how feasible this is with nested functions and what not.
Either way: We should improve the error reporting and documentation on this in some way.
The text was updated successfully, but these errors were encountered:
I'm creating this issue as a follow-up for #740.
The issue is that if a contract has a method a la
Then calling this method will fail at runtime with
ContractTrapped
. This is because thepayable
attribute is missing, the message signature should be#[ink(message, payable)]
.In an ideal world we would detect this already at compile time, though I'm not sure how feasible this is with nested functions and what not.
Either way: We should improve the error reporting and documentation on this in some way.
The text was updated successfully, but these errors were encountered: