Skip to content

Commit

Permalink
Remove unused address from messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jurevans committed Jul 21, 2023
1 parent f0e95c0 commit 5bce1b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
4 changes: 2 additions & 2 deletions apps/extension/src/Approvals/ApproveTx/ConfirmTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ConfirmTx: React.FC<Props> = ({ address, msgId, txType }) => {
case TxType.bond: {
await requester.sendMessage(
Ports.Background,
new SubmitApprovedBondMsg(msgId, address, password)
new SubmitApprovedBondMsg(msgId, password)
);
setStatusInfo("");
setStatus(Status.Completed);
Expand Down Expand Up @@ -91,7 +91,7 @@ export const ConfirmTx: React.FC<Props> = ({ address, msgId, txType }) => {
case TxType.unbond: {
await requester.sendMessage(
Ports.Background,
new SubmitApprovedUnbondMsg(msgId, address, password)
new SubmitApprovedUnbondMsg(msgId, password)
);
setStatusInfo("");
setStatus(Status.Completed);
Expand Down
18 changes: 2 additions & 16 deletions apps/extension/src/background/approvals/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,14 @@ export class SubmitApprovedBondMsg extends Message<void> {
return MessageType.SubmitApprovedBond;
}

constructor(
public readonly msgId: string,
public readonly address: string,
public readonly password: string
) {
constructor(public readonly msgId: string, public readonly password: string) {
super();
}

validate(): void {
if (!this.msgId) {
throw new Error("msgId must not be empty!");
}
if (!this.address) {
throw new Error("address must not be empty!");
}
if (!this.password) {
throw new Error("Password is required to submit bond tx!");
}
Expand All @@ -105,21 +98,14 @@ export class SubmitApprovedUnbondMsg extends Message<void> {
return MessageType.SubmitApprovedUnbond;
}

constructor(
public readonly msgId: string,
public readonly address: string,
public readonly password: string
) {
constructor(public readonly msgId: string, public readonly password: string) {
super();
}

validate(): void {
if (!this.msgId) {
throw new Error("msgId must not be empty!");
}
if (!this.address) {
throw new Error("address must not be empty!");
}
if (!this.password) {
throw new Error("Password is required to submit unbond tx!");
}
Expand Down

0 comments on commit 5bce1b7

Please sign in to comment.