Skip to content

Add blockchain indexer#23

Merged
sethdusek merged 6 commits intoergoplatform:developfrom
zargarzadehm:add-blockchain-indexer
Feb 11, 2025
Merged

Add blockchain indexer#23
sethdusek merged 6 commits intoergoplatform:developfrom
zargarzadehm:add-blockchain-indexer

Conversation

@zargarzadehm
Copy link
Contributor

  • Split wallet methods from node_interface
  • Add new methods indexer_status, get_last_block_headers, get_state_context, nano_ergs_balance, unspent_boxes_by_token_id and unspent_boxes_by_address

- Renamed `src/node_interface.rs` to `src/wallet.rs` and split wallet related functions
- Updated `src/lib.rs` to reflect the module changes
…hods to fetch boxes from the node's indexer.
@coveralls
Copy link

coveralls commented Jan 29, 2025

Pull Request Test Coverage Report for Build 13134268223

Details

  • 0 of 162 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 0.706%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/node_interface.rs 0 60 0.0%
src/wallet.rs 0 102 0.0%
Files with Coverage Reduction New Missed Lines %
src/node_interface.rs 1 0.0%
Totals Coverage Status
Change from base Build 12847504942: -0.1%
Covered Lines: 3
Relevant Lines: 425

💛 - Coveralls

let full_height = res_json["fullHeight"].as_u64().ok_or(NodeError::FailedParsingNodeResponse(res_json.to_string()))?;
let indexed_height = res_json["indexedHeight"].as_u64().ok_or(NodeError::FailedParsingNodeResponse(res_json.to_string()))?;

let is_sync = (full_height as i64 - indexed_height as i64).abs() < 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can be changed to full_height.abs_diff(indexed_height) < 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@sethdusek sethdusek merged commit 8926e95 into ergoplatform:develop Feb 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants