Skip to content

Commit

Permalink
Merge pull request eco-stake#641 from eco-stake/fix-injective-signing
Browse files Browse the repository at this point in the history
Handle Injective pubkey type
  • Loading branch information
tombeynon authored Oct 10, 2022
2 parents b0716a3 + f8156f2 commit c4561eb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/utils/SigningClient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,7 @@ function SigningClient(network, signer) {
signerInfos: [
{
publicKey: {
typeUrl:
coinType === 60
? "/ethermint.crypto.v1.ethsecp256k1.PubKey"
: "/cosmos.crypto.secp256k1.PubKey",
typeUrl: pubkeyTypeUrl(),
value: PubKey.encode({
key: pubkey,
}).finish(),
Expand All @@ -300,6 +297,17 @@ function SigningClient(network, signer) {
}).finish()
}

function pubkeyTypeUrl(){
if(network.path === 'injective'){
return '/injective.crypto.v1beta1.ethsecp256k1.PubKey'
}

if(coinType === 60){
return '/ethermint.crypto.v1.ethsecp256k1.PubKey'
}
return '/cosmos.crypto.secp256k1.PubKey'
}

return {
signer,
registry,
Expand Down

0 comments on commit c4561eb

Please sign in to comment.