diff --git a/launcher/src/backend/ValidatorAccountManager.js b/launcher/src/backend/ValidatorAccountManager.js index edae231bd9..1c1ac4f833 100755 --- a/launcher/src/backend/ValidatorAccountManager.js +++ b/launcher/src/backend/ValidatorAccountManager.js @@ -302,9 +302,9 @@ export class ValidatorAccountManager { if (picked) return data.slashing_protection; return data; } catch (err) { - this.nodeConnection.taskManager.otherTasksHandler(ref, `Deleting Keys Failed`, false, "Deleting Validators Failed:\n" + err); + this.nodeConnection.taskManager.otherTasksHandler(ref, `Deleting Keys Failed`, false, "Deleting Validators Failed:\n" + JSON.stringify(err)); this.nodeConnection.taskManager.otherTasksHandler(ref); - log.error("Deleting Validators Failed:\n", err); + log.error("Deleting Validators Failed:\n", JSON.stringify(err)); return err; } } diff --git a/launcher/src/components/UI/staking-page/StakingScreen.vue b/launcher/src/components/UI/staking-page/StakingScreen.vue index 59b99c5183..52a45502c0 100644 --- a/launcher/src/components/UI/staking-page/StakingScreen.vue +++ b/launcher/src/components/UI/staking-page/StakingScreen.vue @@ -19,6 +19,7 @@ @reset-name="resetValidatorKeyName" @withdraw-single="withdrawModalHandler" @confirm-feerecepient="confirmFeeRecepient" + @delete-feerecepient="deleteFeeRecepient" @delete-preview="deletePreviewKey" @confirm-graffiti="confirmEnteredGrafiti" @confirm-remote="confirmImportRemoteKeys" @@ -447,13 +448,21 @@ const confirmFeeRecepient = async () => { pubkey: key.key, address: stakingStore.enteredFeeRecipientAddress, }); - stakingStore.enteredFeeRecipientAddress = ""; - } else { + } + key.selected = false; + stakingStore.enteredFeeRecipientAddress = ""; + stakingStore.setActivePanel(null); +}; + +const deleteFeeRecepient = async (item) => { + const key = stakingStore.selectKeyForFee; + if (key){ await ControlService.deleteFeeRecipient({ serviceID: key.validatorID, pubkey: key.key, }); } + key.selected = false; stakingStore.enteredFeeRecipientAddress = ""; stakingStore.setActivePanel(null); }; diff --git a/launcher/src/components/UI/staking-page/components/list/ListPanels.vue b/launcher/src/components/UI/staking-page/components/list/ListPanels.vue index 2b5fb2fcd1..2f65201f10 100644 --- a/launcher/src/components/UI/staking-page/components/list/ListPanels.vue +++ b/launcher/src/components/UI/staking-page/components/list/ListPanels.vue @@ -74,6 +74,7 @@ const emit = defineEmits([ "removeGroup", "confirmRename", "confirmFeerecepient", + "deleteFeerecepient", "resetName", "confirmGraffiti", "confirmRemote", @@ -133,6 +134,7 @@ watchEffect(() => { confirmRename: (newName) => emit("confirmRename", newName), resetName: (item) => emit("resetName", item), confirmFeerecepient: (item) => emit("confirmFeerecepient", item), + deleteFeerecepient: (item) => emit("deleteFeerecepient", item), confirmGraffiti: (graffiti) => emit("confirmGraffiti", graffiti), confirmRemote: () => emit("confirmRemote"), }, diff --git a/launcher/src/components/UI/staking-page/components/list/panels/FeePanel.vue b/launcher/src/components/UI/staking-page/components/list/panels/FeePanel.vue index b1aca3da20..942b973e46 100644 --- a/launcher/src/components/UI/staking-page/components/list/panels/FeePanel.vue +++ b/launcher/src/components/UI/staking-page/components/list/panels/FeePanel.vue @@ -13,7 +13,18 @@

{{ alertMessage }}

-
+
+
+ Info +
+ +

{{ infoMessage }}

+
+
Check Icon
+
+
+ Check Icon +
+
@@ -56,7 +75,7 @@ import { ref, watch, computed } from "vue"; import { useStakingStore } from "@/store/theStaking"; -const emit = defineEmits(["confirmFeerecepient"]); +const emit = defineEmits(["confirmFeerecepient","deleteFeerecepient"]); const stakingStore = useStakingStore(); const validName = ref(""); @@ -64,6 +83,7 @@ const alertMessage = ref(""); const isAddressValid = ref(false); const feeRecepientAddress = computed(() => stakingStore.enteredFeeRecipientAddress); +const infoMessage = computed(() => stakingStore.feeRecipientInfoMessage || ""); const inputClass = computed(() => { if (!feeRecepientAddress.value) { @@ -82,7 +102,7 @@ watch(feeRecepientAddress, (newValue) => { const isValidEthereumAddress = /^0x[a-fA-F0-9]{40}$/.test(trimmedName); if (!trimmedName) { - alertMessage.value = "Please enter a wallet address"; + alertMessage.value = ""; isAddressValid.value = false; } else if (!isValidEthereumAddress) { alertMessage.value = "Invalid wallet address"; @@ -97,6 +117,7 @@ watch(feeRecepientAddress, (newValue) => { const confirmFeerecepient = () => { if (!isAddressValid.value) return; + stakingStore.feeRecipientInfoMessage = `Applying new fee recipient address...`; emit("confirmFeerecepient", stakingStore.feeRecepientAddress); }; const cancelFeeRecepient = () => { @@ -104,4 +125,8 @@ const cancelFeeRecepient = () => { stakingStore.enteredFeeRecipientAddress = ""; stakingStore.setActivePanel(null); }; +const deleteFeerecepient = () => { + stakingStore.feeRecipientInfoMessage = `Deleting current fee recipient address...`; + emit("deleteFeerecepient"); +}; diff --git a/launcher/src/components/UI/staking-page/components/list/rows/KeyRow.vue b/launcher/src/components/UI/staking-page/components/list/rows/KeyRow.vue index 437d8dd9fd..0045a2c96f 100644 --- a/launcher/src/components/UI/staking-page/components/list/rows/KeyRow.vue +++ b/launcher/src/components/UI/staking-page/components/list/rows/KeyRow.vue @@ -203,6 +203,8 @@ import { useSetups } from "@/store/setups"; import { useFooter } from "@/store/theFooter"; import { useStakingStore } from "@/store/theStaking"; import { computed } from "vue"; +import ControlService from '@/store/ControlService'; + const props = defineProps({ item: { @@ -448,7 +450,12 @@ const withdrawHandler = () => { stakingStore.setActiveModal("withdraw"); }; -const FeeRecepient = () => { +const FeeRecepient = async () => { + stakingStore.feeRecipientInfoMessage = "Loading fee recipient address..."; + ControlService.getFeeRecipient({serviceID: props.item.validatorID, pubkey: props.item.key}) + .then((res) => { + stakingStore.feeRecipientInfoMessage = res.data?.ethaddress || ""; + }) props.item.selected = true; stakingStore.selectKeyForFee = props.item; stakingStore.setActivePanel(null); diff --git a/launcher/src/components/UI/staking-page/sections/ListSection.vue b/launcher/src/components/UI/staking-page/sections/ListSection.vue index d80b880359..2f52a53c8f 100644 --- a/launcher/src/components/UI/staking-page/sections/ListSection.vue +++ b/launcher/src/components/UI/staking-page/sections/ListSection.vue @@ -25,6 +25,7 @@ @confirm-rename="confirmRename" @reset-name="resetName" @confirm-feerecepient="confirmFeerecepient" + @delete-feerecepient="deleteFeerecepient" @confirm-graffiti="confirmGraffiti" @confirm-remote="confirmRemote" @remove-group="removeGroup" @@ -57,6 +58,7 @@ const emit = defineEmits([ "confirmRename", "renameSingle", "confirmFeerecepient", + "deleteFeerecepient", "deletePreview", "resetName", "confirmGraffiti", @@ -112,6 +114,10 @@ const confirmFeerecepient = (item) => { emit("confirmFeerecepient", item); }; +const deleteFeerecepient = (item) => { + emit("deleteFeerecepient"); +}; + const confirmGraffiti = (item) => { emit("confirmGraffiti", item); };