Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "jest --runInBand -b src/testcases",
"test:interchaintx": "jest --runInBand -b src/testcases/interchaintx",
"test:simple": "jest --runInBand -b src/testcases/simple",
"test:ibc_transfer": "jest --runInBand -b src/testcases/ibc_transfer",
"test:interchain_kv_query": "jest --runInBand -b src/testcases/interchain_kv_query",
"test:interchain_tx_query": "jest --runInBand -b src/testcases/interchain_tx_query",
"test:interchain_tx_query_resubmit": "jest --runInBand -b src/testcases/interchain_tx_query_resubmit",
Expand Down
21 changes: 19 additions & 2 deletions src/helpers/cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,33 @@ export class CosmosWrapper {
return attributes;
}

async feeGrant(to: string): Promise<void> {
const msg = new proto.cosmos.feegrant.v1beta1.MsgGrantAllowance({
granter: this.wallet.address.toString(),
grantee: to,
allowance: cosmosclient.codec.instanceToProtoAny(
new proto.cosmos.feegrant.v1beta1.BasicAllowance({}),
),
});
await this.execTx(
{
amount: [{ denom: NEUTRON_DENOM, amount: '2000000' }],
gas_limit: Long.fromString('600000000'),
},
[msg],
);
}

async executeContract(
contract: string,
msg: string,
msg: string | Record<string, unknown>,
funds: proto.cosmos.base.v1beta1.ICoin[] = [],
sender: string = this.wallet.address.toString(),
): Promise<InlineResponse20075TxResponse> {
const msgExecute = new cosmwasmproto.cosmwasm.wasm.v1.MsgExecuteContract({
sender,
contract,
msg: Buffer.from(msg),
msg: Buffer.from(typeof msg == 'string' ? msg : JSON.stringify(msg)),
funds,
});

Expand Down
Loading