Deprecate DateTime

This commit is contained in:
Simon Warta
2021-02-12 14:28:50 +01:00
parent a23461be11
commit 7e83910617
4 changed files with 10 additions and 4 deletions
+5
View File
@@ -60,6 +60,11 @@
- @cosmjs/launchpad-ledger: Renamed to @cosmjs/ledger-amino.
- @cosmjs/ledger-amino: `LedgerSigner.sign` method renamed `signAmino`.
### Deprecated
- @cosmjs/tendermint-rpc: Deprecate `DateTime` in favour of the free functions
`fromRfc3339WithNanoseconds` and `toRfc3339WithNanoseconds`.
## 0.23.2 (2021-01-06)
### Security
@@ -35,7 +35,7 @@ import {
adaptor34,
broadcastTxCommitSuccess,
Client as TendermintClient,
DateTime,
toRfc3339WithNanoseconds,
} from "@cosmjs/tendermint-rpc";
import { assert } from "@cosmjs/utils";
@@ -114,7 +114,7 @@ export class CosmWasmClient {
},
height: response.block.header.height,
chainId: response.block.header.chainId,
time: DateTime.encode(response.block.header.time),
time: toRfc3339WithNanoseconds(response.block.header.time),
},
txs: response.block.txs,
};
+2 -2
View File
@@ -15,7 +15,7 @@ import {
adaptor34,
broadcastTxCommitSuccess,
Client as TendermintClient,
DateTime,
toRfc3339WithNanoseconds,
} from "@cosmjs/tendermint-rpc";
import { assert, assertDefinedAndNotNull } from "@cosmjs/utils";
import Long from "long";
@@ -185,7 +185,7 @@ export class StargateClient {
},
height: response.block.header.height,
chainId: response.block.header.chainId,
time: DateTime.encode(response.block.header.time),
time: toRfc3339WithNanoseconds(response.block.header.time),
},
txs: response.block.txs,
};
+1
View File
@@ -26,6 +26,7 @@ export function toRfc3339WithNanoseconds(dateTime: ReadonlyDateWithNanoseconds):
return `${millisecondIso.slice(0, -1)}${nanoseconds.padStart(6, "0")}Z`;
}
/** @deprecated Use fromRfc3339WithNanoseconds/toRfc3339WithNanoseconds instead */
export class DateTime {
/** @deprecated Use fromRfc3339WithNanoseconds instead */
public static decode(dateTimeString: string): ReadonlyDateWithNanoseconds {