Skip to content

Commit

Permalink
should use pubkey instead of pubkey.value
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Aug 18, 2023
1 parent 0525906 commit ec04dc5
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/output1/cosmos/staking/v1beta1/tx.amino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const AminoConverter = {
minSelfDelegation: min_self_delegation,
delegatorAddress: delegator_address,
validatorAddress: validator_address,
pubkey: encodePubkey(pubkey.value),
pubkey: encodePubkey(pubkey),
value: {
denom: value.denom,
amount: value.amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const AminoConverter = {
minSelfDelegation: min_self_delegation,
delegatorAddress: delegator_address,
validatorAddress: validator_address,
pubkey: encodePubkey(pubkey.value),
pubkey: encodePubkey(pubkey),
value: {
denom: value.denom,
amount: value.amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Ar
}
};
export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => {
return encodePubkey(content.value);
return encodePubkey(content);
};
export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => {
return decodePubkey(content);
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Ar
}
};
export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => {
return encodePubkey(content.value);
return encodePubkey(content);
};
export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => {
return decodePubkey(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Ar
}
};
export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => {
return encodePubkey(content.value);
return encodePubkey(content);
};
export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => {
return decodePubkey(content);
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Ar
}
};
export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => {
return encodePubkey(content.value);
return encodePubkey(content);
};
export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => {
return decodePubkey(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const AminoConverter = {
minSelfDelegation: min_self_delegation,
delegatorAddress: delegator_address,
validatorAddress: validator_address,
pubkey: encodePubkey(pubkey.value),
pubkey: encodePubkey(pubkey),
value: {
denom: value.denom,
amount: value.amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`cosmos/staking/v1beta1/tx AminoConverter 1`] = `
minSelfDelegation: min_self_delegation,
delegatorAddress: delegator_address,
validatorAddress: validator_address,
pubkey: encodePubkey(pubkey.value),
pubkey: encodePubkey(pubkey),
value: {
denom: value.denom,
amount: value.amount
Expand Down
5 changes: 1 addition & 4 deletions packages/ast/src/encoding/amino/from-amino-json/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,7 @@ export const fromAmino = {
t.callExpression(
t.identifier('encodePubkey'),
[
t.memberExpression(
t.identifier('pubkey'),
t.identifier('value')
)
t.identifier('pubkey')
]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`MsgCreateValidator MsgCreateValidator 1`] = `
"export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => {
return encodePubkey(content.value);
return encodePubkey(content);
};"
`;

Expand Down
7 changes: 1 addition & 6 deletions packages/ast/src/encoding/proto/implements/from-amino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ export const createInterfaceFromAmino = (
return makeFunctionWrapper(functionName, t.returnStatement(
t.callExpression(
t.identifier('encodePubkey'),
[
t.memberExpression(
t.identifier('content'),
t.identifier('value')
)
]
[t.identifier('content')]
)
));
}
Expand Down

0 comments on commit ec04dc5

Please sign in to comment.