From 12c10954fde38aa2b1260991a7beeb4179c0ea3c Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:51:50 +0900 Subject: [PATCH] feat: accaddress --- gen-proto.sh | 4 ++-- src/rest/bank/bank-multisig.spec.ts | 8 ++++---- src/rest/bank/bank.spec.ts | 8 ++++---- src/rest/feegrant/module.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gen-proto.sh b/gen-proto.sh index 5ef46c2..d578f4c 100755 --- a/gen-proto.sh +++ b/gen-proto.sh @@ -39,7 +39,7 @@ npx pbts \ -o ./src/proto.d.ts \ ./src/proto.js -echo Edit proto.d.ts to resolve the conflict of `tendermint` namespace. -echo Require to rename `cometbft` proto +echo Edit proto.d.ts to resolve the conflict of tendermint namespace. +echo Require to rename cometbft proto rm -r ./proto diff --git a/src/rest/bank/bank-multisig.spec.ts b/src/rest/bank/bank-multisig.spec.ts index aa67572..a3d0acf 100644 --- a/src/rest/bank/bank-multisig.spec.ts +++ b/src/rest/bank/bank-multisig.spec.ts @@ -29,8 +29,8 @@ describe('bank', () => { }); const address = cosmosclient.AccAddress.fromPublicKey(multisigPubKey); - const fromAddress = address; - const toAddress = address; + const fromAddress = address.toString(); + const toAddress = address.toString(); // get account info const account = await cosmosclient.rest.auth @@ -45,8 +45,8 @@ describe('bank', () => { // build tx const msgSend = new cosmosclient.proto.cosmos.bank.v1beta1.MsgSend({ - from_address: fromAddress.toString(), - to_address: toAddress.toString(), + from_address: fromAddress, + to_address: toAddress, amount: [{ denom: 'token', amount: '1' }], }); diff --git a/src/rest/bank/bank.spec.ts b/src/rest/bank/bank.spec.ts index a3de46e..5597299 100644 --- a/src/rest/bank/bank.spec.ts +++ b/src/rest/bank/bank.spec.ts @@ -15,8 +15,8 @@ describe('bank', () => { expect(address.toString()).toBe('cosmos14ynfqqa6j5k3kcqm2ymf3l66d9x07ysxgnvdyx'); - const fromAddress = address; - const toAddress = address; + const fromAddress = address.toString(); + const toAddress = address.toString(); // get account info const account = await cosmosclient.rest.auth @@ -31,8 +31,8 @@ describe('bank', () => { // build tx const msgSend = new cosmosclient.proto.cosmos.bank.v1beta1.MsgSend({ - from_address: fromAddress.toString(), - to_address: toAddress.toString(), + from_address: fromAddress, + to_address: toAddress, amount: [{ denom: 'token', amount: '1' }], }); diff --git a/src/rest/feegrant/module.ts b/src/rest/feegrant/module.ts index 43e3fcb..db2fd7f 100644 --- a/src/rest/feegrant/module.ts +++ b/src/rest/feegrant/module.ts @@ -1,7 +1,7 @@ import { QueryApi } from '../../openapi/api'; import { CosmosSDK } from '../../sdk'; -export function allowance(sdk: CosmosSDK, granter: AccAddress, grantee: AccAddress) { +export function allowance(sdk: CosmosSDK, granter: string, grantee: string) { return new QueryApi(undefined, sdk.url).allowance(granter.toString(), grantee.toString()); }