@cosmjs/stargate
Advanced tools
Comparing version 0.24.0-alpha.12 to 0.24.0-alpha.13
@@ -30,6 +30,8 @@ "use strict"; | ||
constructor(additions = {}) { | ||
this.register = Object.assign(Object.assign({}, defaultTypes), additions); | ||
const additionalAminoTypes = Object.values(additions); | ||
const filteredDefaultTypes = Object.entries(defaultTypes).reduce((acc, [key, value]) => (additionalAminoTypes.includes(value) ? acc : Object.assign(Object.assign({}, acc), { [key]: value })), {}); | ||
this.register = Object.assign(Object.assign({}, filteredDefaultTypes), additions); | ||
} | ||
toAmino(typeUrl) { | ||
const type = defaultTypes[typeUrl]; | ||
const type = this.register[typeUrl]; | ||
if (!type) { | ||
@@ -44,3 +46,3 @@ throw new Error("Type URL does not exist in the Amino message type register. " + | ||
var _a; | ||
const [typeUrl] = (_a = Object.entries(defaultTypes).find(([_typeUrl, value]) => value === type)) !== null && _a !== void 0 ? _a : []; | ||
const [typeUrl] = (_a = Object.entries(this.register).find(([_typeUrl, value]) => value === type)) !== null && _a !== void 0 ? _a : []; | ||
if (!typeUrl) { | ||
@@ -47,0 +49,0 @@ throw new Error("Type does not exist in the Amino message type register. " + |
{ | ||
"name": "@cosmjs/stargate", | ||
"version": "0.24.0-alpha.12", | ||
"version": "0.24.0-alpha.13", | ||
"description": "Utilities for Cosmos SDK 0.40", | ||
@@ -51,13 +51,13 @@ "contributors": [ | ||
"@confio/ics23": "^0.6.3", | ||
"@cosmjs/encoding": "^0.24.0-alpha.12", | ||
"@cosmjs/launchpad": "^0.24.0-alpha.12", | ||
"@cosmjs/math": "^0.24.0-alpha.12", | ||
"@cosmjs/proto-signing": "^0.24.0-alpha.12", | ||
"@cosmjs/stream": "^0.24.0-alpha.12", | ||
"@cosmjs/tendermint-rpc": "^0.24.0-alpha.12", | ||
"@cosmjs/utils": "^0.24.0-alpha.12", | ||
"@cosmjs/encoding": "^0.24.0-alpha.13", | ||
"@cosmjs/launchpad": "^0.24.0-alpha.13", | ||
"@cosmjs/math": "^0.24.0-alpha.13", | ||
"@cosmjs/proto-signing": "^0.24.0-alpha.13", | ||
"@cosmjs/stream": "^0.24.0-alpha.13", | ||
"@cosmjs/tendermint-rpc": "^0.24.0-alpha.13", | ||
"@cosmjs/utils": "^0.24.0-alpha.13", | ||
"long": "^4.0.0", | ||
"protobufjs": "~6.10.2" | ||
}, | ||
"gitHead": "fbf5d412c44fa3487128a7967035f97ee45c6b8c" | ||
"gitHead": "a7674d01688462a7a58ff2c5b066348600854f11" | ||
} |
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
1324109
29833