The NNS dapp displays the USD value of the total amount of ICP locked in neurons.
It gets this information from the TVL canister but we want to move this functionality to the nns-dapp canister and remove the TVL canister.
To test the TVL, we need to be able to get an exchange rate from the exchange rate canister. To make this possible while testing, we install a mock exchange rate canister.
Changes
Refactor bin/dfx-software-mock-bitcoin-install to extract bin/dfx-mock-canister-install for installing a generic mock canister.
Add bin/dfx-mock-exchange-rate-canister-install using bin/dfx-mock-canister-install.
Add bin/dfx-mock-exchange-rate-set to populate the exchange rate.
Install the exchange rate canister and set an exchange rate for ICP/USD in bin/dfx-stock-deploy.
Tests
Added bin/dfx-mock-exchange-rate-canister-install.test analogous to bin/dfx-software-mock-bitcoin-install.test and added it to .github/workflows/checks.yml.
Created a snapshot and used it with a version of the nns-dapp that has TVL implemented.
Motivation
The NNS dapp displays the USD value of the total amount of ICP locked in neurons. It gets this information from the TVL canister but we want to move this functionality to the nns-dapp canister and remove the TVL canister.
To test the TVL, we need to be able to get an exchange rate from the exchange rate canister. To make this possible while testing, we install a mock exchange rate canister.
Changes
bin/dfx-software-mock-bitcoin-install
to extractbin/dfx-mock-canister-install
for installing a generic mock canister.bin/dfx-mock-exchange-rate-canister-install
usingbin/dfx-mock-canister-install
.bin/dfx-mock-exchange-rate-set
to populate the exchange rate.bin/dfx-stock-deploy
.Tests
bin/dfx-mock-exchange-rate-canister-install.test
analogous tobin/dfx-software-mock-bitcoin-install.test
and added it to.github/workflows/checks.yml
.