In https://github.com/dfinity/nns-dapp/pull/5339 we added the staking button to the staking table.
This opens the SNS staking modal via a different code path, which didn't load the SNS parameters.
This meant that the minimum neuron stake wasn't available.
Instead of requiring the minimum stake to be available, the SnsStakeNeuronModal component happily ignores this and allows the user to try staking any amount.
But if the amount it too small, claiming the neuron after transferring the tokens fails.
This PR makes sure the parameters are loaded.
We should additionally fix SnsStakeNeuronModal to require the minimum stake to be present but that will be a separate PR.
Changes
Make sure the SNS parameters (which include the minimum stake) are loaded before opening the SnsStakeNeuronModal from the Staking page.
Tests
Unit test added.
Tested manually.
Also tested that staking ICP was not affected and already enforced the minimum stake.
Motivation
In https://github.com/dfinity/nns-dapp/pull/5339 we added the staking button to the staking table. This opens the SNS staking modal via a different code path, which didn't load the SNS parameters. This meant that the minimum neuron stake wasn't available. Instead of requiring the minimum stake to be available, the
SnsStakeNeuronModal
component happily ignores this and allows the user to try staking any amount. But if the amount it too small, claiming the neuron after transferring the tokens fails.This PR makes sure the parameters are loaded. We should additionally fix
SnsStakeNeuronModal
to require the minimum stake to be present but that will be a separate PR.Changes
Make sure the SNS parameters (which include the minimum stake) are loaded before opening the
SnsStakeNeuronModal
from theStaking
page.Tests
Todos