Page MenuHomePhabricator

[Chronik] Add broadcast_txs_and_validate_rawtxs integration test into bitcoinsuite-chronik-client
Needs RevisionPublic

Authored by hazzarust on Sat, Mar 22, 14:25.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

Tests verify the Chronik client's transaction broadcasting and validation capabilities. They check:

Raw transaction validation before broadcasting
Single and batch transaction broadcasting
Error handling for invalid transactions
Token transaction validation (ALP genesis/burn)
Transaction validation throughout its lifecycle
Skip token check options
Proper txid verification

Depends on D17853

Test Plan

Please set BUILD_DIR env to export BUILD_DIR="/path/to/build_dir
UNIX: ./contrib/teamcity/build-configurations.py build-bitcoinsuite-chronik-client

Diff Detail

Repository
rABC Bitcoin ABC
Branch
broadcast
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32800
Build 65088: Build Diffbuild-bitcoinsuite-chronik-client
Build 65087: arc lint + arc unit

Event Timeline

hazzarust created this revision.
Fabien requested changes to this revision.Mon, Mar 24, 10:44
Fabien added a subscriber: Fabien.
Fabien added inline comments.
modules/bitcoinsuite-chronik-client/src/lib.rs
118

Please don't add a new api endpoint for such a thing. Just extend the current function, and if there are some existing clients that got broken then update them as well (but I doubt it because it already default to no skip which is more restrictive).

This revision now requires changes to proceed.Mon, Mar 24, 10:44
PiRK added inline comments.
modules/bitcoinsuite-chronik-client/tests/broadcast_txs_and_validate_rawtx.rs
159–161

Is it possible to reduce the indentation for what follows?

Maybe:

if json_data.get("status").and_then(|status| status.as_str()) == Some("ready") {
    ...
}

Made change to how we handle status and ready to reduce indentation

Fabien requested changes to this revision.Tue, Mar 25, 09:31
Fabien added inline comments.
modules/bitcoinsuite-chronik-client/tests/broadcast_txs_and_validate_rawtx.rs
167 ↗(On Diff #53252)

You really need to get this figured out, remove the \ everywhere. Change the linter config if needed

288–290 ↗(On Diff #53252)
306 ↗(On Diff #53252)

Is this trying to send a txid instead of a tx ?? if yes this is very confusing, just create a byte vector full of garbage instead to clearly show it's not a tx

312 ↗(On Diff #53252)

should be above the previous get_broadcast_txs

333 ↗(On Diff #53252)

Please comment what is going on a bit. Here ut works because the token check is skipped, allowing for the alp burn

This revision now requires changes to proceed.Tue, Mar 25, 09:31
modules/bitcoinsuite-chronik-client/tests/broadcast_txs_and_validate_rawtx.rs
167 ↗(On Diff #53252)

The \ is needed otherwise there is whitespace in the string. I can trim but I would have to trim(). The '\' is used in the bitcoinsuite-chronik-client tests.