Encode nanoseconds in Stargate client

This commit is contained in:
willclarktech 2021-01-05 11:48:15 +00:00
parent ed11f30707
commit 6f668e0bc0
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -12,7 +12,12 @@ import {
} from "@cosmjs/launchpad";
import { Uint53, Uint64 } from "@cosmjs/math";
import { decodePubkey } from "@cosmjs/proto-signing";
import { adaptor34, broadcastTxCommitSuccess, Client as TendermintClient } from "@cosmjs/tendermint-rpc";
import {
adaptor34,
broadcastTxCommitSuccess,
Client as TendermintClient,
DateTime,
} from "@cosmjs/tendermint-rpc";
import { assert, assertDefined } from "@cosmjs/utils";
import Long from "long";
@ -179,7 +184,7 @@ export class StargateClient {
},
height: response.block.header.height,
chainId: response.block.header.chainId,
time: response.block.header.time.toISOString(),
time: DateTime.encode(response.block.header.time),
},
txs: response.block.txs,
};