toEncodedMap method

  1. @override
Map<String, dynamic> toEncodedMap(
  1. dynamic registry
)
override

Implementation

@override
Map<String, dynamic> toEncodedMap(dynamic registry) {
  return {
    'method': method,
    'specVersion': encodeHex(U32Codec.codec.encode(specVersion)),
    'transactionVersion':
        encodeHex(U32Codec.codec.encode(transactionVersion)),
    'genesisHash': genesisHash.replaceAll('0x', ''),
    'blockHash': blockHash.replaceAll('0x', ''),
    '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.
    // signing the metadata hash is not supported now, so
    // the set the enabled byte false with `mode: '00'`.
    'mode': '00',
    // This is for the `CheckMetadataHash` additional signed extensions.
    // Signing the metadata hash is not supported now, so we
    // sign the `Option<MetadataHash>::None` by setting it to '00'.
    'metadataHash': '00',
  };
}