At the moment api-solang offers only one function to invoke contract methods, called messageCall. This function serves two purposes:
if the message is non-mutating, it only makes an RPC call to the method
if the message is mutating, then it will additionally submit an extrinsic that executes the method
An important difference between the RPC call and the actual execution is that the RPC call returns the return value of the method call.
This feature is interesting also for mutating methods. In Nabla for example this allows to estimate how many LP tokens will be minted when depositing some liquidity into a pool.
TODO
Replace messageCall with two new methods:
readMessage: will only execute the RPC method and will return the return value
executeMessage: will additionally submit the extrinsic
The mutating attribute of the metadata should be ignored.
At the moment api-solang offers only one function to invoke contract methods, called
messageCall
. This function serves two purposes:An important difference between the RPC call and the actual execution is that the RPC call returns the return value of the method call.
This feature is interesting also for mutating methods. In Nabla for example this allows to estimate how many LP tokens will be minted when depositing some liquidity into a pool.
TODO
Replace
messageCall
with two new methods:readMessage
: will only execute the RPC method and will return the return valueexecuteMessage
: will additionally submit the extrinsicThe mutating attribute of the metadata should be ignored.