Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
name: scopelint
repo: ScopeLift/scopelint
fromGitHubReleases: true
version: latest
version: v0.0.21
pathInArchive: scopelint-x86_64-linux/scopelint
urlTemplate: https://github.com/ScopeLift/scopelint/releases/download/{{version}}/scopelint-x86_64-linux.tar.xz
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
26 changes: 16 additions & 10 deletions frontend/src/pages/AccountSend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,18 @@ function useSendForm() {
return allString;
});

async function refreshToll() {
await umbra.value?.umbraContract
.toll()
.then((tollValue) => {
toll.value = tollValue;
})
.catch((e) => {
// Avoid bubbling wallet RPC read failures into a full-page error state.
console.warn(`Error fetching toll: ${JSON.stringify(e)}`);
});
}

watch(
// We watch `shouldUseNormalPubKey` to ensure the "Address 0x123 has not registered stealth keys" validation
// message is hidden if the user checks the block after entering an address. We do this by checking if the
Expand All @@ -707,16 +719,6 @@ function useSendForm() {
) => {
_prevTokenValue; // Silence unused var warning.

// Fetch toll.
umbra.value?.umbraContract
.toll()
.then((tollValue) => {
toll.value = tollValue;
})
.catch((e) => {
throw new Error(`Error fetching toll: ${JSON.stringify(e)}`);
});

// Reset acknowledgement if user changes the public key type.
if (!useNormalPubKey) {
advancedAcknowledged.value = false;
Expand Down Expand Up @@ -744,6 +746,7 @@ function useSendForm() {
batchSends.value[0].token = NATIVE_TOKEN.value;
batchSends.value[1].token = NATIVE_TOKEN.value;
}
await refreshToll();
}

const validAmount = Boolean(humanAmountValue) && isValidTokenAmount(humanAmountValue as string) === true;
Expand Down Expand Up @@ -774,6 +777,7 @@ function useSendForm() {

onMounted(async () => {
await setPaymentLinkData();
await refreshToll();
batchSends.value.push(
{ id: 1, receiver: '', token: NATIVE_TOKEN.value, amount: '', warning: '', validationError: false },
{ id: 2, receiver: '', token: NATIVE_TOKEN.value, amount: '', warning: '', validationError: false }
Expand Down Expand Up @@ -951,6 +955,7 @@ function useSendForm() {
if (!signer.value) throw new Error(tc('Send.wallet-not-connected'));
if (!umbra.value) throw new Error('Umbra instance not configured');
showAdvancedSendWarning.value = false;
await refreshToll();

// Verify the recipient ID is valid. (This throws if public keys could not be found. This check is also
// done in the Umbra class `send` method, but we do it here to throw before the user pays for a token approval.
Expand Down Expand Up @@ -1089,6 +1094,7 @@ function useSendForm() {
}
if (!signer.value) throw new Error(tc('Send.wallet-not-connected'));
if (!umbra.value) throw new Error('Umbra instance not configured');
await refreshToll();

// Verify the recipient ID is valid. (This throws if public keys could not be found. This check is also
// done in the Umbra class `send` method, but we do it here to throw before the user pays for a token approval.
Expand Down
Loading