Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add interface to get current root and version - Closes #57 #60

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

hrmhatef
Copy link
Contributor

What was the problem?

This PR resolves #57

How was it solved?

  • Store root and version in rocks-db also update them in commit and revert functions
  • Add a new interface to return root and version

How was it tested?

  • Add a new unit test to test new functionality in Rust side
  • Update unit test to check new interface in JS side
  • All tests passed.

@hrmhatef hrmhatef self-assigned this Sep 29, 2022
@github-actions
Copy link

Commit SHA:209c9da61f790d09f1cf8139346ad3f26337bbb3

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 57_add_interface_current_state 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 74.2 (0.09) 58.94 (-0.12) 79.16 (0.44) 74.05 (0.09)
🟢 state_db.js 69.23 (0.33) 57.14 (-0.17) 72.13 (1.45) 69.23 (0.33)

Copy link
Contributor

@matjazv matjazv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good implementation!

src/consts.rs Outdated Show resolved Hide resolved
src/state_db.rs Outdated Show resolved Hide resolved
src/state_db.rs Outdated Show resolved Hide resolved
 - Add func get_current_state to return root and version
 - Version is a height of StateDB
 - Update JS to use the that interface, also update the unit test
 - Introduce a new struct CurrentState to convert info <-> bytes
 - Also add a unit test for CurrentState funcs
 - Introduce BlockHeight as a new strong type
@hrmhatef hrmhatef force-pushed the 57_add_interface_current_state branch from 0e734fe to bea57a2 Compare September 29, 2022 15:13
@github-actions
Copy link

Commit SHA:71a69f202cc953273b16fe1aa985929360cd6c20

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 57_add_interface_current_state 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 74.2 (0.09) 58.94 (-0.12) 79.16 (0.44) 74.05 (0.09)
🟢 state_db.js 69.23 (0.33) 57.14 (-0.17) 72.13 (1.45) 69.23 (0.33)

@github-actions
Copy link

Commit SHA:3160b644d381aa3fb35e958b8501e90f6b736d0b

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 57_add_interface_current_state 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 74.2 (0.09) 58.94 (-0.12) 79.16 (0.44) 74.05 (0.09)
🟢 state_db.js 69.23 (0.33) 57.14 (-0.17) 72.13 (1.45) 69.23 (0.33)

@shuse2 shuse2 merged commit cc02719 into main Sep 29, 2022
@shuse2 shuse2 deleted the 57_add_interface_current_state branch September 29, 2022 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add interface to get current root and version
3 participants