-
Notifications
You must be signed in to change notification settings - Fork 373
Description
I'm submitting a ...
- Bug report
What is the current behavior and expected behavior?
The return result of executing a smart contract of pallet-contracts via the RPC method call
is of type ContractExecResult
.
This type contains an entry of type ContractReturnFlags
. This type is defined as
export interface ContractReturnFlags extends Set {
readonly isRevert: boolean;
}
However, the actual value returned changed between version 13.1.1 and version 13.2.1. Given a value flags
of type ContractReturnFlags
and executing the following line:
console.log(flags.toHuman(), flags.bits?.toNumber(), flags.isRevert)
results in the following output:
-
at version 13.1.1
- if the contract did not revert:
[] undefined false
- if the contract reverted:
[ 'Revert' ] undefined true
- if the contract did not revert:
-
On version 13.2.1 I get the output instead:
- if the contract did not revert:
{ bits: '0' } 0 undefined
- if the contract reverted:
{ bits: '1' } 1 undefined
- if the contract did not revert:
This suggests that the decoding has an unintended breaking change or the typings should be adapted. Possibly other bitflag types are affected as well.
Please tell us about your environment:
-
Version: 13.1.1 and 13.2.1
-
Environment:
- Node.js
- Browser
- Other (limited support for other environments)
-
Language:
- JavaScript
- TypeScript (include tsc --version)
- Other
Metadata
Metadata
Assignees
Labels
Type
Projects
Status