Skip to content

Commit

Permalink
fix certain toAmino methods for qa
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrajovic committed Jun 21, 2024
1 parent 25c402f commit d401495
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
39 changes: 32 additions & 7 deletions packages/sdk-ts/src/core/modules/authz/msgs/MsgExec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import snakecaseKeys from 'snakecase-keys'
// import snakecaseKeys from 'snakecase-keys'
import { MsgBase } from '../../MsgBase'
import type { Msgs } from '../../msgs'
import {
Expand Down Expand Up @@ -63,17 +63,42 @@ export default class MsgExec extends MsgBase<
...proto,
}
}
//
// public toAmino() {
// const proto = this.toProto()
// const message = {
// ...snakecaseKeys(proto),
// msgs: proto.msgs,
// }
//
// return {
// type: 'cosmos-sdk/MsgExec',
// value: message as unknown as MsgExec.Object,
// }
// }


public toAmino() {
const proto = this.toProto()
const message = {
...snakecaseKeys(proto),
msgs: proto.msgs,
}
const { params } = this
const msgs = Array.isArray(params.msgs) ? params.msgs : [params.msgs]
//
// const message2 = msgs.map((msg) => {
// return {
// type: msg.toAmino().type,
// value: msg.toAmino().value,
// }
// }) as any

// const msg = message2[0];

return {
type: 'cosmos-sdk/MsgExec',
value: message as unknown as MsgExec.Object,
value: {
grantee: params.grantee,
msgs: msgs.map((msg) => {
return msg.toEip712()
}),
},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ export default class MsgSubmitTextProposal extends MsgBase<
const { params } = this

const messageWithProposalType = snakecaseKeys({
proposer: params.proposer,
content: {
type: 'cosmos-sdk/TextProposal',
value: this.getContent(),
},
initialDeposit: [
{
denom: params.deposit.denom,
amount: params.deposit.amount,
},
],
content: {
type_url: 'cosmos-sdk/TextProposal',
value: this.getContent(),
},
proposer: params.proposer,
})

return {
Expand Down

0 comments on commit d401495

Please sign in to comment.