@cosmjs/tendermint-rpc
Advanced tools
Comparing version 0.32.0 to 0.32.1
@@ -209,12 +209,2 @@ "use strict"; | ||
} | ||
/** | ||
* In some cases a timestamp is optional and set to the value 0 in Go. | ||
* This can lead to strings like "0001-01-01T00:00:00Z" (see https://github.com/cosmos/cosmjs/issues/704#issuecomment-797122415). | ||
* This decoder tries to clean up such encoding from the API and turn them | ||
* into undefined values. | ||
*/ | ||
function decodeOptionalTime(timestamp) { | ||
const nonZeroTime = timestamp && !timestamp.startsWith("0001-01-01"); | ||
return nonZeroTime ? (0, dates_1.fromRfc3339WithNanoseconds)(timestamp) : undefined; | ||
} | ||
function decodeCommitSignature(data) { | ||
@@ -224,3 +214,3 @@ return { | ||
validatorAddress: data.validator_address ? (0, encoding_1.fromHex)(data.validator_address) : undefined, | ||
timestamp: decodeOptionalTime(data.timestamp), | ||
timestamp: data.timestamp ? (0, dates_1.fromRfc3339WithNanoseconds)(data.timestamp) : undefined, | ||
signature: data.signature ? (0, encoding_1.fromBase64)(data.signature) : undefined, | ||
@@ -227,0 +217,0 @@ }; |
@@ -207,12 +207,2 @@ "use strict"; | ||
} | ||
/** | ||
* In some cases a timestamp is optional and set to the value 0 in Go. | ||
* This can lead to strings like "0001-01-01T00:00:00Z" (see https://github.com/cosmos/cosmjs/issues/704#issuecomment-797122415). | ||
* This decoder tries to clean up such encoding from the API and turn them | ||
* into undefined values. | ||
*/ | ||
function decodeOptionalTime(timestamp) { | ||
const nonZeroTime = timestamp && !timestamp.startsWith("0001-01-01"); | ||
return nonZeroTime ? (0, dates_1.fromRfc3339WithNanoseconds)(timestamp) : undefined; | ||
} | ||
function decodeCommitSignature(data) { | ||
@@ -222,3 +212,3 @@ return { | ||
validatorAddress: data.validator_address ? (0, encoding_1.fromHex)(data.validator_address) : undefined, | ||
timestamp: decodeOptionalTime(data.timestamp), | ||
timestamp: data.timestamp ? (0, dates_1.fromRfc3339WithNanoseconds)(data.timestamp) : undefined, | ||
signature: data.signature ? (0, encoding_1.fromBase64)(data.signature) : undefined, | ||
@@ -225,0 +215,0 @@ }; |
@@ -207,12 +207,2 @@ "use strict"; | ||
} | ||
/** | ||
* In some cases a timestamp is optional and set to the value 0 in Go. | ||
* This can lead to strings like "0001-01-01T00:00:00Z" (see https://github.com/cosmos/cosmjs/issues/704#issuecomment-797122415). | ||
* This decoder tries to clean up such encoding from the API and turn them | ||
* into undefined values. | ||
*/ | ||
function decodeOptionalTime(timestamp) { | ||
const nonZeroTime = timestamp && !timestamp.startsWith("0001-01-01"); | ||
return nonZeroTime ? (0, dates_1.fromRfc3339WithNanoseconds)(timestamp) : undefined; | ||
} | ||
function decodeCommitSignature(data) { | ||
@@ -222,3 +212,3 @@ return { | ||
validatorAddress: data.validator_address ? (0, encoding_1.fromHex)(data.validator_address) : undefined, | ||
timestamp: decodeOptionalTime(data.timestamp), | ||
timestamp: data.timestamp ? (0, dates_1.fromRfc3339WithNanoseconds)(data.timestamp) : undefined, | ||
signature: data.signature ? (0, encoding_1.fromBase64)(data.signature) : undefined, | ||
@@ -225,0 +215,0 @@ }; |
{ | ||
"name": "@cosmjs/tendermint-rpc", | ||
"version": "0.32.0", | ||
"version": "0.32.1", | ||
"description": "Tendermint RPC clients", | ||
@@ -45,9 +45,9 @@ "contributors": [ | ||
"dependencies": { | ||
"@cosmjs/crypto": "^0.32.0", | ||
"@cosmjs/encoding": "^0.32.0", | ||
"@cosmjs/json-rpc": "^0.32.0", | ||
"@cosmjs/math": "^0.32.0", | ||
"@cosmjs/socket": "^0.32.0", | ||
"@cosmjs/stream": "^0.32.0", | ||
"@cosmjs/utils": "^0.32.0", | ||
"@cosmjs/crypto": "^0.32.1", | ||
"@cosmjs/encoding": "^0.32.1", | ||
"@cosmjs/json-rpc": "^0.32.1", | ||
"@cosmjs/math": "^0.32.1", | ||
"@cosmjs/socket": "^0.32.1", | ||
"@cosmjs/stream": "^0.32.1", | ||
"@cosmjs/utils": "^0.32.1", | ||
"axios": "^1.6.0", | ||
@@ -54,0 +54,0 @@ "readonly-date": "^1.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
420164
6867
Updated@cosmjs/crypto@^0.32.1
Updated@cosmjs/encoding@^0.32.1
Updated@cosmjs/json-rpc@^0.32.1
Updated@cosmjs/math@^0.32.1
Updated@cosmjs/socket@^0.32.1
Updated@cosmjs/stream@^0.32.1
Updated@cosmjs/utils@^0.32.1