Skip to content

Fail to unmarshal tx data from a block #14

@Caveman07

Description

@Caveman07

Using:
node.js@v12.16.1
@tendermint/amino-js@0.6.0
@tendermint/belt@0.2.1

Trying to decode tx from block with:


import { decodeString, unmarshalTx } from '@tendermint/amino-js';
import { base64ToBytes } from '@tendermint/belt'; 

  decodeTx(txHash) {
    try {
      const decoded = base64ToBytes(txHash); 
      const unmarshaled = unmarshalTx(decoded);
      return decoded
    }
    catch (error) {
      console.log(error)
      return null
    }
  }

Throws this error on every tx data string from blocks:
For example:

3wEoKBapCluclZNGChRm0QXKCIrFakuLzpL0oqW3MHzH/RIUyTRRx8hJmGRpUL1G+yw8xXQRSHsaFE3H7L64W8UP7sICyw32yIwMNrM6IhMKBXVhdG9tEgoyMDQ5ODQ5MTQwEhAKCgoFdWF0b20SATEQgNMOGmoKJuta6YchAzpqNiIl4AIZl3rIYeUHLU10NyCNiEapGx3SKZ338sTwEkDgs/cND/XjaiNySQxrLQRGbgaLqhyyjozvYozBqvmAiEVxiG5W63DzhGm8UeMxXDh3zemjyMfkZB0XAGqcjs8V

at block 1416024

Error: unmarshal to types.Tx failed after 4 bytes (unrecognized prefix bytes 282816A9): 282816A90A5B9C9593460A1466D105C.....6A9C8ECF15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions