From 085856d3916de2f71ea580618d9e70626f5c4f79 Mon Sep 17 00:00:00 2001
From: abefernan <44572727+abefernan@users.noreply.github.com>
Date: Tue, 11 Jun 2024 13:54:04 +0200
Subject: [PATCH] Tweak namings
---
...ls.tsx => TxMsgBeginRedelegateDetails.tsx} | 6 ++---
...> TxMsgWithdrawDelegatorRewardDetails.tsx} | 8 ++++---
...ateForm.tsx => MsgBeginRedelegateForm.tsx} | 23 +++++++++++--------
.../MsgForm/MsgCreateVestingAccountForm.tsx | 8 +++----
.../CreateTxForm/MsgForm/MsgDelegateForm.tsx | 8 +++----
.../MsgForm/MsgExecuteContractForm.tsx | 15 +++++++-----
.../MsgForm/MsgInstantiateContract2Form.tsx | 12 +++++-----
.../MsgForm/MsgInstantiateContractForm.tsx | 12 +++++-----
.../MsgForm/MsgMigrateContractForm.tsx | 15 +++++++-----
.../CreateTxForm/MsgForm/MsgSendForm.tsx | 8 +++----
.../MsgForm/MsgSetWithdrawAddressForm.tsx | 8 +++----
.../CreateTxForm/MsgForm/MsgTransferForm.tsx | 8 +++----
.../MsgForm/MsgUndelegateForm.tsx | 12 ++++------
.../MsgForm/MsgUpdateAdminForm.tsx | 12 ++++++----
.../CreateTxForm/MsgForm/MsgVoteForm.tsx | 8 +++----
...tsx => MsgWithdrawDelegatorRewardForm.tsx} | 16 ++++++-------
16 files changed, 95 insertions(+), 84 deletions(-)
rename components/dataViews/TransactionInfo/{TxMsgRedelegateDetails.tsx => TxMsgBeginRedelegateDetails.tsx} (90%)
rename components/dataViews/TransactionInfo/{TxMsgClaimRewardsDetails.tsx => TxMsgWithdrawDelegatorRewardDetails.tsx} (82%)
rename components/forms/CreateTxForm/MsgForm/{MsgRedelegateForm.tsx => MsgBeginRedelegateForm.tsx} (91%)
rename components/forms/CreateTxForm/MsgForm/{MsgClaimRewardsForm.tsx => MsgWithdrawDelegatorRewardForm.tsx} (88%)
diff --git a/components/dataViews/TransactionInfo/TxMsgRedelegateDetails.tsx b/components/dataViews/TransactionInfo/TxMsgBeginRedelegateDetails.tsx
similarity index 90%
rename from components/dataViews/TransactionInfo/TxMsgRedelegateDetails.tsx
rename to components/dataViews/TransactionInfo/TxMsgBeginRedelegateDetails.tsx
index 66a39db..5cca2da 100644
--- a/components/dataViews/TransactionInfo/TxMsgRedelegateDetails.tsx
+++ b/components/dataViews/TransactionInfo/TxMsgBeginRedelegateDetails.tsx
@@ -4,11 +4,11 @@ import { useChains } from "../../../context/ChainsContext";
import { printableCoin } from "../../../lib/displayHelpers";
import HashView from "../HashView";
-interface TxMsgRedelegateDetailsProps {
+interface TxMsgBeginRedelegateDetailsProps {
readonly msgValue: MsgBeginRedelegate;
}
-const TxMsgRedelegateDetails = ({ msgValue }: TxMsgRedelegateDetailsProps) => {
+const TxMsgBeginRedelegateDetails = ({ msgValue }: TxMsgBeginRedelegateDetailsProps) => {
const { chain } = useChains();
assert(
msgValue.amount,
@@ -65,4 +65,4 @@ const TxMsgRedelegateDetails = ({ msgValue }: TxMsgRedelegateDetailsProps) => {
);
};
-export default TxMsgRedelegateDetails;
+export default TxMsgBeginRedelegateDetails;
diff --git a/components/dataViews/TransactionInfo/TxMsgClaimRewardsDetails.tsx b/components/dataViews/TransactionInfo/TxMsgWithdrawDelegatorRewardDetails.tsx
similarity index 82%
rename from components/dataViews/TransactionInfo/TxMsgClaimRewardsDetails.tsx
rename to components/dataViews/TransactionInfo/TxMsgWithdrawDelegatorRewardDetails.tsx
index 5df2193..319deda 100644
--- a/components/dataViews/TransactionInfo/TxMsgClaimRewardsDetails.tsx
+++ b/components/dataViews/TransactionInfo/TxMsgWithdrawDelegatorRewardDetails.tsx
@@ -1,11 +1,13 @@
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
import HashView from "../HashView";
-interface TxMsgClaimRewardsDetailsProps {
+interface TxMsgWithdrawDelegatorRewardDetailsProps {
readonly msgValue: MsgWithdrawDelegatorReward;
}
-const TxMsgClaimRewardsDetails = ({ msgValue }: TxMsgClaimRewardsDetailsProps) => (
+const TxMsgWithdrawDelegatorRewardDetails = ({
+ msgValue,
+}: TxMsgWithdrawDelegatorRewardDetailsProps) => (
<>
MsgWithdrawDelegatorReward
@@ -44,4 +46,4 @@ const TxMsgClaimRewardsDetails = ({ msgValue }: TxMsgClaimRewardsDetailsProps) =
>
);
-export default TxMsgClaimRewardsDetails;
+export default TxMsgWithdrawDelegatorRewardDetails;
diff --git a/components/forms/CreateTxForm/MsgForm/MsgRedelegateForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgBeginRedelegateForm.tsx
similarity index 91%
rename from components/forms/CreateTxForm/MsgForm/MsgRedelegateForm.tsx
rename to components/forms/CreateTxForm/MsgForm/MsgBeginRedelegateForm.tsx
index 2f7a433..1227598 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgRedelegateForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgBeginRedelegateForm.tsx
@@ -1,5 +1,5 @@
import SelectValidator from "@/components/SelectValidator";
-import { EncodeObject } from "@cosmjs/proto-signing";
+import { MsgBeginRedelegateEncodeObject } from "@cosmjs/stargate";
import { useEffect, useState } from "react";
import { MsgGetter } from "..";
import { useChains } from "../../../../context/ChainsContext";
@@ -9,17 +9,17 @@ import { MsgCodecs, MsgTypeUrls } from "../../../../types/txMsg";
import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
-interface MsgRedelegateFormProps {
- readonly delegatorAddress: string;
+interface MsgBeginRedelegateFormProps {
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgRedelegateForm = ({
- delegatorAddress,
+const MsgBeginRedelegateForm = ({
+ senderAddress,
setMsgGetter,
deleteMsg,
-}: MsgRedelegateFormProps) => {
+}: MsgBeginRedelegateFormProps) => {
const { chain } = useChains();
const [validatorSrcAddress, setValidatorSrcAddress] = useState("");
@@ -81,13 +81,16 @@ const MsgRedelegateForm = ({
})();
const msgValue = MsgCodecs[MsgTypeUrls.BeginRedelegate].fromPartial({
- delegatorAddress,
+ delegatorAddress: senderAddress,
validatorSrcAddress,
validatorDstAddress,
amount: microCoin,
});
- const msg: EncodeObject = { typeUrl: MsgTypeUrls.BeginRedelegate, value: msgValue };
+ const msg: MsgBeginRedelegateEncodeObject = {
+ typeUrl: MsgTypeUrls.BeginRedelegate,
+ value: msgValue,
+ };
setMsgGetter({ isMsgValid, msg });
}, [
@@ -95,7 +98,7 @@ const MsgRedelegateForm = ({
chain.assets,
chain.chainId,
chain.displayDenom,
- delegatorAddress,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
@@ -173,4 +176,4 @@ const MsgRedelegateForm = ({
);
};
-export default MsgRedelegateForm;
+export default MsgBeginRedelegateForm;
diff --git a/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx
index 13d33a2..0849da2 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx
@@ -13,13 +13,13 @@ import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
interface MsgCreateVestingAccountFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgCreateVestingAccountForm = ({
- fromAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgCreateVestingAccountFormProps) => {
@@ -87,7 +87,7 @@ const MsgCreateVestingAccountForm = ({
})();
const msgValue = MsgCodecs[MsgTypeUrls.CreateVestingAccount].fromPartial({
- fromAddress,
+ fromAddress: senderAddress,
toAddress,
amount: microCoin ? [microCoin] : [],
endTime: timestampFromDatetimeLocal(endTime, "s"),
@@ -103,7 +103,7 @@ const MsgCreateVestingAccountForm = ({
chain.chainId,
chain.displayDenom,
delayed,
- fromAddress,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgDelegateForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgDelegateForm.tsx
index 53ef890..3414147 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgDelegateForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgDelegateForm.tsx
@@ -10,12 +10,12 @@ import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
interface MsgDelegateFormProps {
- readonly delegatorAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDelegateFormProps) => {
+const MsgDelegateForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgDelegateFormProps) => {
const { chain } = useChains();
const [validatorAddress, setValidatorAddress] = useState("");
@@ -66,7 +66,7 @@ const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDeleg
})();
const msgValue = MsgCodecs[MsgTypeUrls.Delegate].fromPartial({
- delegatorAddress,
+ delegatorAddress: senderAddress,
validatorAddress,
amount: microCoin,
});
@@ -79,7 +79,7 @@ const MsgDelegateForm = ({ delegatorAddress, setMsgGetter, deleteMsg }: MsgDeleg
chain.assets,
chain.chainId,
chain.displayDenom,
- delegatorAddress,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgExecuteContractForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgExecuteContractForm.tsx
index ec795bc..db6b434 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgExecuteContractForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgExecuteContractForm.tsx
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
};
interface MsgExecuteContractFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgExecuteContractForm = ({
- fromAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgExecuteContractFormProps) => {
@@ -126,23 +126,26 @@ const MsgExecuteContractForm = ({
}
})();
- const msgValue = MsgCodecs[MsgTypeUrls.Execute].fromPartial({
- sender: fromAddress,
+ const msgValue = MsgCodecs[MsgTypeUrls.ExecuteContract].fromPartial({
+ sender: senderAddress,
contract: contractAddress,
msg: msgContentUtf8Array,
funds: microCoin ? [microCoin] : [],
});
- const msg: MsgExecuteContractEncodeObject = { typeUrl: MsgTypeUrls.Execute, value: msgValue };
+ const msg: MsgExecuteContractEncodeObject = {
+ typeUrl: MsgTypeUrls.ExecuteContract,
+ value: msgValue,
+ };
setMsgGetter({ isMsgValid, msg });
}, [
chain.addressPrefix,
chain.assets,
chain.chainId,
- fromAddress,
msgContent,
selectedDenom.value,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx b/components/forms/CreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx
index d2d9ab2..858b015 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
};
interface MsgInstantiateContract2FormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgInstantiateContract2Form = ({
- fromAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgInstantiateContract2FormProps) => {
@@ -163,8 +163,8 @@ const MsgInstantiateContract2Form = ({
}
})();
- const msgValue = MsgCodecs[MsgTypeUrls.Instantiate2].fromPartial({
- sender: fromAddress,
+ const msgValue = MsgCodecs[MsgTypeUrls.InstantiateContract2].fromPartial({
+ sender: senderAddress,
codeId: BigInt(codeId),
label,
admin: adminAddress,
@@ -175,7 +175,7 @@ const MsgInstantiateContract2Form = ({
});
const msg: MsgInstantiateContract2EncodeObject = {
- typeUrl: MsgTypeUrls.Instantiate2,
+ typeUrl: MsgTypeUrls.InstantiateContract2,
value: msgValue,
};
@@ -184,9 +184,9 @@ const MsgInstantiateContract2Form = ({
chain.addressPrefix,
chain.assets,
chain.chainId,
- fromAddress,
msgContent,
selectedDenom.value,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgInstantiateContractForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgInstantiateContractForm.tsx
index 256b915..186dd8f 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgInstantiateContractForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgInstantiateContractForm.tsx
@@ -25,13 +25,13 @@ const getDenomOptions = (assets: ChainInfo["assets"]) => {
};
interface MsgInstantiateContractFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgInstantiateContractForm = ({
- fromAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgInstantiateContractFormProps) => {
@@ -141,8 +141,8 @@ const MsgInstantiateContractForm = ({
}
})();
- const msgValue = MsgCodecs[MsgTypeUrls.Instantiate].fromPartial({
- sender: fromAddress,
+ const msgValue = MsgCodecs[MsgTypeUrls.InstantiateContract].fromPartial({
+ sender: senderAddress,
codeId: BigInt(codeId),
label,
admin: adminAddress,
@@ -151,7 +151,7 @@ const MsgInstantiateContractForm = ({
});
const msg: MsgInstantiateContractEncodeObject = {
- typeUrl: MsgTypeUrls.Instantiate,
+ typeUrl: MsgTypeUrls.InstantiateContract,
value: msgValue,
};
@@ -160,9 +160,9 @@ const MsgInstantiateContractForm = ({
chain.addressPrefix,
chain.assets,
chain.chainId,
- fromAddress,
msgContent,
selectedDenom.value,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx
index b0e7755..2d177b5 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgMigrateContractForm.tsx
@@ -12,13 +12,13 @@ import StackableContainer from "../../../layout/StackableContainer";
const JsonEditor = dynamic(() => import("../../../inputs/JsonEditor"), { ssr: false });
interface MsgMigrateContractFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgMigrateContractForm = ({
- fromAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgMigrateContractFormProps) => {
@@ -69,17 +69,20 @@ const MsgMigrateContractForm = ({
}
})();
- const msgValue = MsgCodecs[MsgTypeUrls.Migrate].fromPartial({
- sender: fromAddress,
+ const msgValue = MsgCodecs[MsgTypeUrls.MigrateContract].fromPartial({
+ sender: senderAddress,
contract: contractAddress,
codeId: BigInt(codeId),
msg: msgContentUtf8Array,
});
- const msg: MsgMigrateContractEncodeObject = { typeUrl: MsgTypeUrls.Migrate, value: msgValue };
+ const msg: MsgMigrateContractEncodeObject = {
+ typeUrl: MsgTypeUrls.MigrateContract,
+ value: msgValue,
+ };
setMsgGetter({ isMsgValid, msg });
- }, [chain.addressPrefix, chain.chainId, fromAddress, msgContent, setMsgGetter, trimmedInputs]);
+ }, [chain.addressPrefix, chain.chainId, msgContent, senderAddress, setMsgGetter, trimmedInputs]);
return (
diff --git a/components/forms/CreateTxForm/MsgForm/MsgSendForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgSendForm.tsx
index 02f7c50..d5b0a7a 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgSendForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgSendForm.tsx
@@ -21,12 +21,12 @@ const getDenomOptions = (assets: readonly RegistryAsset[]) => {
};
interface MsgSendFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps) => {
+const MsgSendForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgSendFormProps) => {
const { chain } = useChains();
const denomOptions = getDenomOptions(chain.assets);
@@ -103,7 +103,7 @@ const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps)
})();
const msgValue = MsgCodecs[MsgTypeUrls.Send].fromPartial({
- fromAddress,
+ fromAddress: senderAddress,
toAddress,
amount: microCoin ? [microCoin] : [],
});
@@ -115,8 +115,8 @@ const MsgSendForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgSendFormProps)
chain.addressPrefix,
chain.assets,
chain.chainId,
- fromAddress,
selectedDenom.value,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgSetWithdrawAddressForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgSetWithdrawAddressForm.tsx
index 4081bff..b902779 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgSetWithdrawAddressForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgSetWithdrawAddressForm.tsx
@@ -8,13 +8,13 @@ import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
interface MsgSetWithdrawAddressFormProps {
- readonly delegatorAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
const MsgSetWithdrawAddressForm = ({
- delegatorAddress,
+ senderAddress,
setMsgGetter,
deleteMsg,
}: MsgSetWithdrawAddressFormProps) => {
@@ -42,13 +42,13 @@ const MsgSetWithdrawAddressForm = ({
};
const msgValue = MsgCodecs[MsgTypeUrls.SetWithdrawAddress].fromPartial({
- delegatorAddress,
+ delegatorAddress: senderAddress,
withdrawAddress,
});
const msg: EncodeObject = { typeUrl: MsgTypeUrls.SetWithdrawAddress, value: msgValue };
setMsgGetter({ isMsgValid, msg });
- }, [chain.addressPrefix, chain.chainId, delegatorAddress, setMsgGetter, trimmedInputs]);
+ }, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
return (
diff --git a/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx
index 6c89d34..895b7b4 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx
@@ -24,12 +24,12 @@ const humanTimestampOptions = [
];
interface MsgTransferFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFormProps) => {
+const MsgTransferForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgTransferFormProps) => {
const { chain } = useChains();
const [toAddress, setToAddress] = useState("");
@@ -107,7 +107,7 @@ const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFo
};
const msgValue = MsgCodecs[MsgTypeUrls.Transfer].fromPartial({
- sender: fromAddress,
+ sender: senderAddress,
receiver: toAddress,
token: { denom, amount },
sourcePort,
@@ -119,7 +119,7 @@ const MsgTransferForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgTransferFo
const msg: MsgTransferEncodeObject = { typeUrl: MsgTypeUrls.Transfer, value: msgValue };
setMsgGetter({ isMsgValid, msg });
- }, [chain.chainId, fromAddress, setMsgGetter, trimmedInputs]);
+ }, [chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
return (
diff --git a/components/forms/CreateTxForm/MsgForm/MsgUndelegateForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgUndelegateForm.tsx
index 4d6fbb7..0138c90 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgUndelegateForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgUndelegateForm.tsx
@@ -10,16 +10,12 @@ import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
interface MsgUndelegateFormProps {
- readonly delegatorAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgUndelegateForm = ({
- delegatorAddress,
- setMsgGetter,
- deleteMsg,
-}: MsgUndelegateFormProps) => {
+const MsgUndelegateForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgUndelegateFormProps) => {
const { chain } = useChains();
const [validatorAddress, setValidatorAddress] = useState("");
@@ -70,7 +66,7 @@ const MsgUndelegateForm = ({
})();
const msgValue = MsgCodecs[MsgTypeUrls.Undelegate].fromPartial({
- delegatorAddress,
+ delegatorAddress: senderAddress,
validatorAddress,
amount: microCoin,
});
@@ -83,7 +79,7 @@ const MsgUndelegateForm = ({
chain.assets,
chain.chainId,
chain.displayDenom,
- delegatorAddress,
+ senderAddress,
setMsgGetter,
trimmedInputs,
]);
diff --git a/components/forms/CreateTxForm/MsgForm/MsgUpdateAdminForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgUpdateAdminForm.tsx
index ced812b..85b8657 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgUpdateAdminForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgUpdateAdminForm.tsx
@@ -8,12 +8,16 @@ import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
interface MsgUpdateAdminFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateAdminFormProps) => {
+const MsgUpdateAdminForm = ({
+ senderAddress,
+ setMsgGetter,
+ deleteMsg,
+}: MsgUpdateAdminFormProps) => {
const { chain } = useChains();
const [contractAddress, setContractAddress] = useState("");
@@ -52,7 +56,7 @@ const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateA
};
const msgValue = MsgCodecs[MsgTypeUrls.UpdateAdmin].fromPartial({
- sender: fromAddress,
+ sender: senderAddress,
contract: contractAddress,
newAdmin: newAdminAddress,
});
@@ -60,7 +64,7 @@ const MsgUpdateAdminForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgUpdateA
const msg: MsgUpdateAdminEncodeObject = { typeUrl: MsgTypeUrls.UpdateAdmin, value: msgValue };
setMsgGetter({ isMsgValid, msg });
- }, [chain.addressPrefix, chain.chainId, fromAddress, setMsgGetter, trimmedInputs]);
+ }, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
return (
diff --git a/components/forms/CreateTxForm/MsgForm/MsgVoteForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgVoteForm.tsx
index 7618e25..b46949d 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgVoteForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgVoteForm.tsx
@@ -20,12 +20,12 @@ const selectVoteOptions = voteOptions.map((opt) => {
});
interface MsgVoteFormProps {
- readonly fromAddress: string;
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps) => {
+const MsgVoteForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps) => {
const [proposalId, setProposalId] = useState("0");
const [selectedVote, setSelectedVote] = useState(selectVoteOptions[0]);
@@ -64,7 +64,7 @@ const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps)
})();
const msgValue = MsgCodecs[MsgTypeUrls.Vote].fromPartial({
- voter: fromAddress,
+ voter: senderAddress,
proposalId: proposalIdBigInt,
option: selectedVote.value,
});
@@ -72,7 +72,7 @@ const MsgVoteForm = ({ fromAddress, setMsgGetter, deleteMsg }: MsgVoteFormProps)
const msg: MsgVoteEncodeObject = { typeUrl: MsgTypeUrls.Vote, value: msgValue };
setMsgGetter({ isMsgValid, msg });
- }, [fromAddress, selectedVote.value, setMsgGetter, trimmedInputs]);
+ }, [selectedVote.value, senderAddress, setMsgGetter, trimmedInputs]);
return (
diff --git a/components/forms/CreateTxForm/MsgForm/MsgClaimRewardsForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgWithdrawDelegatorRewardForm.tsx
similarity index 88%
rename from components/forms/CreateTxForm/MsgForm/MsgClaimRewardsForm.tsx
rename to components/forms/CreateTxForm/MsgForm/MsgWithdrawDelegatorRewardForm.tsx
index 64eb507..742062b 100644
--- a/components/forms/CreateTxForm/MsgForm/MsgClaimRewardsForm.tsx
+++ b/components/forms/CreateTxForm/MsgForm/MsgWithdrawDelegatorRewardForm.tsx
@@ -8,17 +8,17 @@ import { MsgCodecs, MsgTypeUrls } from "../../../../types/txMsg";
import Input from "../../../inputs/Input";
import StackableContainer from "../../../layout/StackableContainer";
-interface MsgClaimRewardsFormProps {
- readonly delegatorAddress: string;
+interface MsgWithdrawDelegatorRewardFormProps {
+ readonly senderAddress: string;
readonly setMsgGetter: (msgGetter: MsgGetter) => void;
readonly deleteMsg: () => void;
}
-const MsgClaimRewardsForm = ({
- delegatorAddress,
+const MsgWithdrawDelegatorRewardForm = ({
+ senderAddress,
setMsgGetter,
deleteMsg,
-}: MsgClaimRewardsFormProps) => {
+}: MsgWithdrawDelegatorRewardFormProps) => {
const { chain } = useChains();
const [validatorAddress, setValidatorAddress] = useState("");
@@ -45,7 +45,7 @@ const MsgClaimRewardsForm = ({
};
const msgValue = MsgCodecs[MsgTypeUrls.WithdrawDelegatorReward].fromPartial({
- delegatorAddress,
+ delegatorAddress: senderAddress,
validatorAddress,
});
@@ -55,7 +55,7 @@ const MsgClaimRewardsForm = ({
};
setMsgGetter({ isMsgValid, msg });
- }, [chain.addressPrefix, chain.chainId, delegatorAddress, setMsgGetter, trimmedInputs]);
+ }, [chain.addressPrefix, chain.chainId, senderAddress, setMsgGetter, trimmedInputs]);
return (
@@ -100,4 +100,4 @@ const MsgClaimRewardsForm = ({
);
};
-export default MsgClaimRewardsForm;
+export default MsgWithdrawDelegatorRewardForm;