Merge pull request #644 from cosmos/fix-amino-type-msgwithdrawdelegationreward

Fix Launchpad distribution types
This commit is contained in:
Simon Warta 2021-01-28 15:24:56 +01:00 committed by GitHub
commit 043d9e4798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

View File

@ -72,7 +72,8 @@ export function isMsgVerifyInvariant(msg: Msg): msg is MsgVerifyInvariant {
/** Changes the withdraw address for a delegator (or validator self-delegation) */
export interface MsgSetWithdrawAddress extends Msg {
readonly type: "cosmos-sdk/MsgSetWithdrawAddress";
// NOTE: Type string and names diverge here!
readonly type: "cosmos-sdk/MsgModifyWithdrawAddress";
readonly value: {
/** Bech32 account address */
readonly delegator_address: string;
@ -82,12 +83,14 @@ export interface MsgSetWithdrawAddress extends Msg {
}
export function isMsgSetWithdrawAddress(msg: Msg): msg is MsgSetWithdrawAddress {
return (msg as MsgSetWithdrawAddress).type === "cosmos-sdk/MsgSetWithdrawAddress";
// NOTE: Type string and names diverge here!
return (msg as MsgSetWithdrawAddress).type === "cosmos-sdk/MsgModifyWithdrawAddress";
}
/** Message for delegation withdraw from a single validator */
export interface MsgWithdrawDelegatorReward extends Msg {
readonly type: "cosmos-sdk/MsgWithdrawDelegatorReward";
// NOTE: Type string and names diverge here!
readonly type: "cosmos-sdk/MsgWithdrawDelegationReward";
readonly value: {
/** Bech32 account address */
readonly delegator_address: string;
@ -97,7 +100,8 @@ export interface MsgWithdrawDelegatorReward extends Msg {
}
export function isMsgWithdrawDelegatorReward(msg: Msg): msg is MsgWithdrawDelegatorReward {
return (msg as MsgWithdrawDelegatorReward).type === "cosmos-sdk/MsgWithdrawDelegatorReward";
// NOTE: Type string and names diverge here!
return (msg as MsgWithdrawDelegatorReward).type === "cosmos-sdk/MsgWithdrawDelegationReward";
}
/** Message for validator withdraw */

View File

@ -47,7 +47,7 @@ export interface MsgVerifyInvariant extends Msg {
export declare function isMsgVerifyInvariant(msg: Msg): msg is MsgVerifyInvariant;
/** Changes the withdraw address for a delegator (or validator self-delegation) */
export interface MsgSetWithdrawAddress extends Msg {
readonly type: "cosmos-sdk/MsgSetWithdrawAddress";
readonly type: "cosmos-sdk/MsgModifyWithdrawAddress";
readonly value: {
/** Bech32 account address */
readonly delegator_address: string;
@ -58,7 +58,7 @@ export interface MsgSetWithdrawAddress extends Msg {
export declare function isMsgSetWithdrawAddress(msg: Msg): msg is MsgSetWithdrawAddress;
/** Message for delegation withdraw from a single validator */
export interface MsgWithdrawDelegatorReward extends Msg {
readonly type: "cosmos-sdk/MsgWithdrawDelegatorReward";
readonly type: "cosmos-sdk/MsgWithdrawDelegationReward";
readonly value: {
/** Bech32 account address */
readonly delegator_address: string;

View File

@ -117,7 +117,7 @@ describe("AminoTypes", () => {
value: msg,
});
const expected: MsgSetWithdrawAddress = {
type: "cosmos-sdk/MsgSetWithdrawAddress",
type: "cosmos-sdk/MsgModifyWithdrawAddress",
value: {
delegator_address: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
withdraw_address: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
@ -136,7 +136,7 @@ describe("AminoTypes", () => {
value: msg,
});
const expected: MsgWithdrawDelegatorReward = {
type: "cosmos-sdk/MsgWithdrawDelegatorReward",
type: "cosmos-sdk/MsgWithdrawDelegationReward",
value: {
delegator_address: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
validator_address: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",

View File

@ -111,7 +111,7 @@ function createDefaultTypes(prefix: string): Record<string, AminoConverter> {
}),
},
"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": {
aminoType: "cosmos-sdk/MsgSetWithdrawAddress",
aminoType: "cosmos-sdk/MsgModifyWithdrawAddress",
toAmino: ({
delegatorAddress,
withdrawAddress,
@ -132,7 +132,7 @@ function createDefaultTypes(prefix: string): Record<string, AminoConverter> {
}),
},
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": {
aminoType: "cosmos-sdk/MsgWithdrawDelegatorReward",
aminoType: "cosmos-sdk/MsgWithdrawDelegationReward",
toAmino: ({
delegatorAddress,
validatorAddress,