Skip to content

Commit

Permalink
add converters and encoders
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Sep 13, 2024
1 parent b09d24f commit 4fe5206
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions libs/interchainjs/src/signing-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ export class SigningClient {
}
}

/**
* register converters
*/
addConverters = (converters: AminoConverter[]) => {
this.converters.push(...converters);
};

/**
* register encoders
*/
addEncoders = (encoders: Encoder[]) => {
this.encoders.push(...encoders);
};

private get queryClient() {
return this.client;
}
Expand Down
4 changes: 2 additions & 2 deletions networks/injective/starship/__tests__/gov.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import './setup.test';

import { Msgs } from '@interchainjs/cosmos-types/cosmos';
import { Asset } from '@chain-registry/types';
import { EthSecp256k1Auth } from '@interchainjs/auth/ethSecp256k1';
import { AminoSigner } from '@interchainjs/cosmos/signers/amino';
Expand Down Expand Up @@ -119,10 +118,11 @@ describe('Governance tests for injective', () => {
useLegacyBroadcastTxCommit: true,
},
preferredSignType: 'direct',
registry: Msgs.map((g) => [g.typeUrl, g])
}
);

signingClient.addEncoders(toEncoders(MsgDelegate, TextProposal, MsgSubmitProposal, MsgVote));

// Create custom cosmos interchain client
queryClient = new RpcQuery(injRpcEndpoint);

Expand Down

0 comments on commit 4fe5206

Please sign in to comment.