toEncodedMap method
Map<String, dynamic>
toEncodedMap(
- dynamic registry
)
override
Implementation
@override
Map<String, dynamic> toEncodedMap(dynamic registry) {
return {
'signer': signer,
'method': method,
'signature': signature,
'era': eraPeriod == 0
? '00'
: Era.codec.encodeMortal(blockNumber, eraPeriod),
'nonce': encodeHex(CompactCodec.codec.encode(nonce)),
/* 'assetId': maybeAssetIdEncoded(registry), */
'tip': tip is int
? encodeHex(CompactCodec.codec.encode(tip))
: encodeHex(CompactBigIntCodec.codec.encode(tip)),
// This is for the `CheckMetadataHash` signed extension.
// it sets the mode byte to true if a metadataHash is present.
'mode': metadataHash == '00' ? '00' : '01',
// This is for the `CheckMetadataHash` additional signed extensions.
// we sign the `Option<MetadataHash>::None` by setting it to '00'.
'metadataHash': metadataHash == '00'
? '00'
: '01${metadataHash.replaceAll('0x', '')}',
};
}