Skip to content

Commit

Permalink
web-wallet: use w3sper's minimum stake amount instead of env var
Browse files Browse the repository at this point in the history
Resolves #3010
  • Loading branch information
ascartabelli committed Nov 19, 2024
1 parent de8b157 commit 5f101c1
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added gas settings validation on Unstake / Widthdraw Rewards flows [#2000]
- Add temporary link to the block explorer on the dashboard [#2882]
- Update Staking-Related functionality to make use of w3sper [#3006]
- Add minimum stake amount supplied by w3sper instead of using an env var [#3010]

### Changed

Expand Down Expand Up @@ -347,6 +348,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2990]: https://github.com/dusk-network/rusk/issues/2990
[#3000]: https://github.com/dusk-network/rusk/issues/3000
[#3006]: https://github.com/dusk-network/rusk/issues/3006
[#3010]: https://github.com/dusk-network/rusk/issues/3010

<!-- VERSIONS -->

Expand Down
1 change: 0 additions & 1 deletion web-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ VITE_GAS_LIMIT_UPPER=1000000000
VITE_GAS_PRICE_DEFAULT=1
VITE_GAS_PRICE_LOWER=1
VITE_MIGRATE_CONTRACT=""
VITE_MINIMUM_ALLOWED_STAKE=1000
VITE_MODE_MAINTENANCE=false
VITE_NODE_URL="" # connect to a specific node
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
export let spendable = 0n;
$: [gasSettings, language, minAllowedStake] = collectSettings($settingsStore);
$: [gasSettings, language] = collectSettings($settingsStore);
$: duskFormatter = createCurrencyFormatter(language, "DUSK", 9);
const gasLimits = $gasStore;
Expand All @@ -54,7 +54,6 @@
"gasPriceLower",
]),
getKey("language"),
getKey("minAllowedStake"),
]);
/** @type {Record<string, (info: StakeInfo) => boolean>} */
Expand Down Expand Up @@ -139,7 +138,7 @@
$: ({ currentOperation } = $operationsStore);
const { hideStakingNotice } = $settingsStore;
$: ({ balance, syncStatus } = $walletStore);
$: ({ balance, minimumStake, syncStatus } = $walletStore);
$: isSyncOK = !(syncStatus.isInProgress || !!syncStatus.error);
$: if (!isSyncOK) {
disableAllOperations(descriptor.operations);
Expand All @@ -154,7 +153,7 @@
formatter={duskFormatter}
{gasLimits}
{gasSettings}
{minAllowedStake}
minAllowedStake={luxToDusk(minimumStake)}
on:operationChange
on:suppressStakingNotice
rewards={luxToDusk(stakeInfo.reward)}
Expand Down
1 change: 0 additions & 1 deletion web-wallet/src/lib/stores/settingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const initialState = {
gasLimit: BigInt(import.meta.env.VITE_GAS_LIMIT_DEFAULT ?? 20000000),
gasPrice: BigInt(import.meta.env.VITE_GAS_PRICE_DEFAULT ?? 1),
hideStakingNotice: false,
minAllowedStake: parseInt(import.meta.env.VITE_MINIMUM_ALLOWED_STAKE, 10),
userId: "",
};

Expand Down
1 change: 0 additions & 1 deletion web-wallet/src/lib/stores/stores.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type SettingsStoreContent = {
gasPrice: bigint;
hideStakingNotice: boolean;
language: string;
minAllowedStake: number;
userId: string;
};

Expand Down
2 changes: 0 additions & 2 deletions web-wallet/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default defineConfig(({ mode }) => {
VITE_GAS_PRICE_DEFAULT: env.VITE_GAS_PRICE_DEFAULT,
VITE_GAS_PRICE_LOWER: env.VITE_GAS_PRICE_LOWER,
VITE_GAS_PRICE_UPPER: env.VITE_GAS_PRICE_UPPER,
VITE_MINIMUM_ALLOWED_STAKE: env.VITE_MINIMUM_ALLOWED_STAKE,
VITE_NODE_URL: env.VITE_NODE_URL,
},
},
Expand Down Expand Up @@ -99,7 +98,6 @@ export default defineConfig(({ mode }) => {
VITE_GAS_LIMIT_UPPER: "1000000000",
VITE_GAS_PRICE_DEFAULT: "1",
VITE_GAS_PRICE_LOWER: "1",
VITE_MINIMUM_ALLOWED_STAKE: "1234",
VITE_NODE_URL: "",
},
environment: "jsdom",
Expand Down

0 comments on commit 5f101c1

Please sign in to comment.