Page MenuHomePhabricator

[CHRONIK] add is_final to tx struct in util.rs
ClosedPublic

Authored by hazzarust on Nov 17 2024, 20:35.

Details

Reviewers
Fabien
tobias_ruck
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC8f49415dbac4: [CHRONIK] add is_final to tx struct in util.rs
Summary

is_final determines whether or not a block is final, and returns a bool dependant on outcome

Test Plan

ninja check-functional

Event Timeline

Owners added a reviewer: Restricted Owners Package.Nov 17 2024, 20:35

renamed variable from x to block

Fabien requested changes to this revision.Nov 18 2024, 08:42
Fabien added a subscriber: Fabien.

When you add a new feature like this you need to also add a test for the new feature so you demonstrate that it works as expected.
You can look at the functional tests in test/functional/chronik_*.py for test examples, and most likely you can extend one of the existing test instead of creating a new one.

chronik/chronik-indexer/src/query/util.rs
167

Note that this will not be enough for pre-consensus and will need to be reworked at some point. Not blocking though, this is still an improvement over no flag at all.

chronik/chronik-proto/proto/chronik.proto
110

The fact that this relates to the block for now is an implementation detail. After pre-consensus this will no longer be the case, but the field can remain and still means the tx is final.

This revision now requires changes to proceed.Nov 18 2024, 08:42

Added tests post revision comments

This comment was removed by hazzarust.

Made changes as revised - added tests

tobias_ruck added a subscriber: tobias_ruck.
tobias_ruck added inline comments.
chronik/chronik-indexer/src/query/util.rs
167 ↗(On Diff #50963)
test/functional/chronik_avalanche.py
121 ↗(On Diff #50963)

you meant this?

159 ↗(On Diff #50963)

no commented code plx

This revision now requires changes to proceed.Nov 19 2024, 22:12
hazzarust marked 2 inline comments as done.

Changed comments and code in proto and chronik_avalanche.py

squashed 2 commits into 1 and updated

This revision is now accepted and ready to land.Nov 20 2024, 11:43
This revision was automatically updated to reflect the committed changes.