Skip to content

Fix/staketb

Leister Francisco Alvarado Campos requested to merge fix/staketb into testnet

What does this PR do?

Overview

  • Move the stakes to completed or cancelled scope once the stake is not in progress.
  • Update the voting power of the accounts once the final value is completed.

Issue: #7 (closed)

Steps to test

Production Environment (testnet/mainnet)

  1. Deploy the latest commit from the this branch to stake.libre account.
  2. Run migrate action until it returns an error saying Migration is completed.
  3. Validate the new entries have been added to completed and cancelled scope of the stake table. Since only stakes that have been unstaked are going to appear in the cancelled scope, that table could be empty.
  4. Validate that the table stake scoped by stake.libre only contains entries with status = 1 which means, the stakes are in progress.
  5. Perform a new stake and validate that the new entry is added to the stake table scoped by stake.libre.

Local Libre Network

  1. Get the version of stake.libre that is deployed on testnet or mainnet (at the moment of writing this document they are the same), run some stakes and call the migrate1 action, and later migrate2 until they return the following errors respectively: Migration #1 is completed and Migration #2 is completed.
  2. Unstake a couple of rows.
  3. Get latest version currently deployed on testnet and mainnet by downloading the respective wasm and abi files.
  4. Run migrate to validate that the stakes that are not in progress are moved to completed/canceled scope.
  5. Perform a couple of stakes (1 day, 1 week and 1 month)
  6. Passed two days from the first stake, you are able to claim the rewards, claim it and validate that your stake row has been moved to scope completed.
  7. Cancel a stake in progress by unstaking (unstake action) it.
  8. Validate the cancelled stake is moved to canceled scope.

Issue: #8 (closed)

Steps to test

Production Environment (testnet/mainnet)

  1. Stake and validate voting power is increased.
  2. Unstake/claim and after the updatevp call, check the voting power is decreased.
  3. Check that while a voting power update, the voting power is not updated until the end of the calculation, this way the issue with external contracts reading low/wrong voting power values is fixed.
    1. Write down the current voting power of an account.
    2. Call updatevp with low steps 20.
    3. Check the attribute vp_state of the table state is set to 1 (calculating voting power).
    4. Check the voting power of the selected account hasn't changed.
    5. Call updatevp with high steps 2000.
    6. Check the voting power of the selected account has been updated.
Edited by Leister Francisco Alvarado Campos

Merge request reports