Skip to content

Commit

Permalink
Merge branch 'master' into configurable-prevent-authz-exec-types
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon authored Jun 23, 2023
2 parents dd3d917 + 43dfe3d commit f38a597
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adapters/DefaultSigningAdapter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class DefaultSigningAdapter {
}
}
let aminoMessage = this.aminoTypes.toAmino(message)
if(this.network.authzAminoGenericOnly){
if(this.network.authzAminoLiftedValues){
switch (aminoMessage.type) {
case 'cosmos-sdk/MsgGrant':
aminoMessage = aminoMessage.value
Expand Down
3 changes: 2 additions & 1 deletion src/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
]
},
{
"name": "terra"
"name": "terra",
"authzAminoLiftedValues": false
},
{
"name": "terra2"
Expand Down
2 changes: 2 additions & 0 deletions src/utils/Chain.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Chain = (data) => {
const authzSupport = data.authzSupport ?? data.params?.authz
const authzAminoSupport = data.authzAminoSupport ?? true
const authzAminoGenericOnly = authzAminoSupport && (data.authzAminoGenericOnly ?? !sdkAuthzAminoSupport)
const authzAminoLiftedValues = authzAminoSupport && (data.authzAminoLiftedValues ?? authzAminoGenericOnly)
const authzAminoExecPreventTypes = data.authzAminoExecPreventTypes || []
const apiVersions = {
gov: sdk46OrLater ? 'v1' : 'v1beta1',
Expand All @@ -29,6 +30,7 @@ const Chain = (data) => {
authzSupport,
authzAminoSupport,
authzAminoGenericOnly,
authzAminoLiftedValues,
authzAminoExecPreventTypes,
apiVersions,
denom: data.denom || baseAsset?.base?.denom,
Expand Down
1 change: 1 addition & 0 deletions src/utils/Network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Network {
this.authzSupport = this.chain.authzSupport
this.authzAminoSupport = this.chain.authzAminoSupport
this.authzAminoGenericOnly = this.chain.authzAminoGenericOnly
this.authzAminoLiftedValues = this.chain.authzAminoLiftedValues
this.authzAminoExecPreventTypes = this.chain.authzAminoExecPreventTypes
this.txTimeout = this.data.txTimeout || 60_000
this.keywords = this.buildKeywords()
Expand Down

0 comments on commit f38a597

Please sign in to comment.