From 37c631c4a9f3c5fb3e8c7ba11e6ab5becd67ef91 Mon Sep 17 00:00:00 2001 From: hangTaishan Date: Thu, 18 Mar 2021 19:13:50 +0800 Subject: [PATCH] #add originalTxs in queryBlock --- dist/src/modules/tendermint.js | 1 + src/modules/tendermint.ts | 1 + test/tendermint.test.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/src/modules/tendermint.js b/dist/src/modules/tendermint.js index 7284f760..ef4415f2 100644 --- a/dist/src/modules/tendermint.js +++ b/dist/src/modules/tendermint.js @@ -62,6 +62,7 @@ var Tendermint = /*#__PURE__*/function () { txs.forEach(function (msg) { decodedTxs.push(_this.client.protobuf.deserializeTx(msg)); }); + res.block.data.originalTxs = res.block.data.txs; res.block.data.txs = decodedTxs; } diff --git a/src/modules/tendermint.ts b/src/modules/tendermint.ts index 548ad3a7..a4e43195 100644 --- a/src/modules/tendermint.ts +++ b/src/modules/tendermint.ts @@ -40,6 +40,7 @@ export class Tendermint { this.client.protobuf.deserializeTx(msg) ); }); + res.block.data.originalTxs = res.block.data.txs; res.block.data.txs = decodedTxs; } return res as types.Block; diff --git a/test/tendermint.test.ts b/test/tendermint.test.ts index 81db1c6f..3b045a17 100644 --- a/test/tendermint.test.ts +++ b/test/tendermint.test.ts @@ -23,7 +23,7 @@ describe('Tendermint Tests', () => { 'query block by height', async () => { await BaseTest.getClient() - .tendermint.queryBlock(196) + .tendermint.queryBlock(1755803) .then(res => { console.log(JSON.stringify(res)); })