Skip to content

Tests - operation in Hive - Power up

Operation: Power up - transfer_to_vesting_operation, // 3

Configuration:

based on: https://gitlab.syncad.com/hive/hive/-/blob/develop/libraries/protocol/include/hive/protocol/config.hpp#L175

HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS, default mainnet value: 30 days
HIVE_DELAYED_VOTING_INTERVAL_SECONDS, default mainnet value: 1 day

Test cases:

  • 1. User converts Hive to HP and transfers them to own account ( empty {to}).
  • 2. User converts Hive to HP and transfers them to own account ({to} = {from} ).
  • 3. User converts Hive to HP and transfers them to someone else account.
Expected results - to be checked in all above test cases:
  1. Sender HIVE balance is reduced by {amount}.
  2. Receiver HP balance is increased by {amount} after operation.
  3. The conversion is done using current exchange rate.
  4. After operation: the virtual operation: transfer_to_vesting_completed is created.
  5. After operation: The Governance voting power is not increased.
  6. After operation: RC current_mana is reduced.
  7. After operation: RC max_mana is increased.
  8. After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS- HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 29) days: The Governance voting power is not increased.
  9. After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS (mainnet value: 30) days: the Governance voting power is increased.
  10. After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS (mainnet value: 30) days: the virtual operation: delayed_voting_operation is generated.

Test cases:

  • 4. User converts Hive to HP (Power Up 1) and after 5 days user converts Hive to HP again (Power Up 2).
Expected results:
  1. (Power up 1) Sender HIVE balance is reduced by {amount1}.
  2. (Power up 1) Receiver HP balance is increased by {amount1} after operation.
  3. (Power up 1) The conversion is done using the current exchange rate.
  4. (Power up 1) After operation: the virtual operation: transfer_to_vesting_completed is created
  5. (Power up 1) After operation: The Governance voting power is not increased.
  6. (Power up 1) RC current_mana is reduced.
  7. (Power up 1) RC max_mana is increased.
  8. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 5) days: Sender HIVE balance is reduced by {amount2}.
  9. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 5) days: Receiver HP balance is increased by {amount2} after operation.
  10. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 5) days: The conversion is done using current exchange rate.
  11. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 35) days: RC max_mana is increased.
  12. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 5) days: After operation: the virtual operation: transfer_to_vesting_completed is created.
  13. (Power up 2) After 5 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 5) days: RC current_mana is reduced (compare to RC after Power up 1).
  14. (Power up 1) After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS- HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 29) days: The Governance voting power is not increased.
  15. (Power up 1) After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS (mainnet value: 30) days: the Governance voting power is increased.
  16. (Power up 1) After HIVE_DELAYED_VOTING_TOTAL_INTERVAL_SECONDS (mainnet value: 30) days: the virtual operation: delayed_voting_operation is generated.
  17. (Power up 2) After 34 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 34) days: The Governance voting power is not increased.
  18. (Power up 2) After 35 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 35) days: the Governance voting power is increased.
  19. (Power up 2) After 35 * HIVE_DELAYED_VOTING_INTERVAL_SECONDS (mainnet value: 35) days: the virtual operation: delayed_voting_operation is generated.
Edited by Aleksandra Grabowska