Open TorstenStueber opened 1 month ago
@pendulum-chain/product this is a low priority feature to improve the usability of our library api-solang
that we use in wasm-deploy, the Portal and Vortex.
Hey team! Please add your planning poker estimate with Zenhub @b-yap @bogdanS98 @ebma @gianfra-t @Sharqiewicz
Since the addition of a "skip dry running feature" for message calls, every call to
executeMessage
orcreateExecuteMessageExtrinsic
can have one of three execution paths:skipDryRunning
isn'ttrue
and the RPC call was successfulskipDryRunning
isn'ttrue
and the RPC call was a failureskipDryRunning
is `true.The return type of these functions (
ExecuteMessageResult
forexecuteMessage
andCreateExecuteMessageExtrinsicResult
forcreateExecuteMessageExtrinsic
) have an entryresult
which is defined to optional.However, this value is always defined whenever
skipDryRunning
isn'ttrue
and is alwaysundefined
wheneverskipDryRunning
istrue
.That means that whenever the caller does want to skip dry running, they can be ensured that
result
is defined. This is not reflected in the TypeScript typings. Right now they would either have to use the non-null assertion operator!
or would need to add a code path for the option thatresult
is undefined.TODO
executeMessage
andcreateExecuteMessageExtrinsic
into two versions, where one skips dry running and the other doesn't and add the proper typingsexecuteMessage
andcreateExecuteMessageExtrinsic