Skip to content

Commit

Permalink
Merge pull request eco-stake#630 from eco-stake/adjust-msgexec-limit
Browse files Browse the repository at this point in the history
Adjust Osmosis MsgExec amino limit
  • Loading branch information
tombeynon authored Oct 5, 2022
2 parents 54b1a85 + 7845235 commit 2b68593
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"ownerAddress": "osmovaloper1u5v0m74mql5nzfx2yh43s2tke4mvzghr6m2n5t",
"default": true,
"maxPerDay": 1,
"authzAminoSupport": true,
"authzAminoExecSupport": false
"authzAminoSupport": true
},
{
"name": "juno",
Expand Down
1 change: 0 additions & 1 deletion src/utils/Chain.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Chain = (data) => {
estimatedApr: data.params?.calculated_apr,
authzSupport: data.authzSupport ?? data.params?.authz,
authzAminoSupport: data.authzAminoSupport ?? false,
authzAminoExecSupport: data.authzAminoExecSupport ?? data.authzAminoSupport ?? false,
denom: data.denom || baseAsset?.base?.denom,
display: data.display || baseAsset?.display?.denom,
symbol: data.symbol || baseAsset?.symbol,
Expand Down
1 change: 0 additions & 1 deletion src/utils/Network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class Network {
this.apyEnabled = data.apyEnabled !== false && !!this.estimatedApr && this.estimatedApr > 0
this.authzSupport = this.chain.authzSupport
this.authzAminoSupport = this.chain.authzAminoSupport
this.authzAminoExecSupport = this.chain.authzAminoExecSupport
this.defaultGasPrice = this.decimals && format(bignumber(multiply(0.000000025, pow(10, this.decimals))), { notation: 'fixed', precision: 4}) + this.denom
this.gasPrice = this.data.gasPrice || this.defaultGasPrice
if(this.gasPrice){
Expand Down
11 changes: 7 additions & 4 deletions src/utils/SigningClient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function SigningClient(network, signer) {
let aminoMsgs
try {
aminoMsgs = convertToAmino(messages)
} catch (e) { }
} catch (e) { console.log(e) }
if(aminoMsgs && signer.signAmino){
// Sign as amino if possible for Ledger and Keplr support
const signDoc = makeAminoSignDoc(aminoMsgs, fee, chainId, memo, accountNumber, sequence);
Expand Down Expand Up @@ -241,9 +241,12 @@ function SigningClient(network, signer) {
if(message.typeUrl.startsWith('/cosmos.authz') && !network.authzAminoSupport){
throw new Error('This chain does not support amino conversion for Authz messages')
}
if(message.typeUrl === '/cosmos.authz.v1beta1.MsgExec' && !network.authzAminoExecSupport){
// Osmosis MsgExec is broken with Amino currently
throw new Error('This chain does not support amino conversion for Authz Exec messages')
if(message.typeUrl === '/cosmos.authz.v1beta1.MsgExec' && network.path === 'osmosis'){
// Osmosis MsgExec gov is broken with Amino currently
// See https://github.com/osmosis-labs/cosmos-sdk/pull/342
if(message.value.msgs.some(msg => msg.typeUrl.startsWith('/cosmos.gov'))){
throw new Error('Osmosis does not support amino conversion for Authz Exec gov messages')
}
}
return aminoTypes.toAmino(message)
})
Expand Down

0 comments on commit 2b68593

Please sign in to comment.