Skip to content

Commit

Permalink
fix msgupdateauthorization
Browse files Browse the repository at this point in the history
  • Loading branch information
freeelancer committed Mar 12, 2024
1 parent 708ce63 commit 0718ca5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/core/smartaccount/v1/msgs/MsgUpdateAuthorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export class MsgUpdateAuthorization extends JSONSerializable<
const {
value: { account, fallback, authorizationMsgs },
} = data;
return new MsgUpdateAuthorization(account, fallback, authorizationMsgs);
return new MsgUpdateAuthorization(
account,
fallback,
authorizationMsgs.map(msg => AuthorizationMsg.fromAmino(msg))
);
}

public toAmino(): MsgUpdateAuthorization.Amino {
Expand All @@ -43,7 +47,7 @@ export class MsgUpdateAuthorization extends JSONSerializable<
value: {
account,
fallback,
authorizationMsgs,
authorizationMsgs: authorizationMsgs.map(msg => msg.toAmino()),
},
};
}
Expand All @@ -52,7 +56,10 @@ export class MsgUpdateAuthorization extends JSONSerializable<
data: MsgUpdateAuthorization.Data
): MsgUpdateAuthorization {
const { account, fallback, authorizationMsgs } = data;
return new MsgUpdateAuthorization(account, fallback, authorizationMsgs);
const authMsgs = authorizationMsgs.map(msg =>
AuthorizationMsg.fromData(msg)
);
return new MsgUpdateAuthorization(account, fallback, authMsgs);
}

public toData(): MsgUpdateAuthorization.Data {
Expand All @@ -61,7 +68,7 @@ export class MsgUpdateAuthorization extends JSONSerializable<
'@type': '/terra.smartaccount.v1.MsgUpdateAuthorization',
account,
fallback,
authorizationMsgs,
authorizationMsgs: authorizationMsgs.map(msg => msg.toData()),
};
}

Expand Down Expand Up @@ -104,15 +111,15 @@ export namespace MsgUpdateAuthorization {
value: {
account: AccAddress;
fallback: boolean;
authorizationMsgs: AuthorizationMsg[];
authorizationMsgs: AuthorizationMsg.Amino[];
};
}

export interface Data {
'@type': '/terra.smartaccount.v1.MsgUpdateAuthorization';
account: AccAddress;
fallback: boolean;
authorizationMsgs: AuthorizationMsg[];
authorizationMsgs: AuthorizationMsg.Data[];
}

export type Proto = MsgUpdateAuthorization_pb;
Expand Down

0 comments on commit 0718ca5

Please sign in to comment.