Page MenuHomePhabricator

Add a test for ABC-specific getblocktemplate behavior
ClosedPublic

Authored by jasonbcox on Aug 20 2020, 20:41.

Details

Summary

First step in T1014

As we modify behavior in getblocktemplate, we really need better test coverage.
D7201 (f8360b5e981) is one such change. This patch tests that behavior specifically
but this test can be expanded to cover other changes that we may have made or will
make in the future.

Test Plan

Before D7201, this test should fail

git checkout f8360b5e981^
git cherry-pick this-patch
test_runner.py abc_mining_basic

But the test passes today:

git checkout this-patch
test_runner.py abc_mining_basic
test_runner.py --with-axionactivation abc_mining_basic

Diff Detail

Repository
rABC Bitcoin ABC
Branch
abc-mining-basic
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12438
Build 25038: Build Diffbuild-clang-10 · build-without-wallet · build-diff · build-clang-tidy
Build 25037: arc lint + arc unit

Event Timeline

Make the test more friendly to future additions

Fabien requested changes to this revision.Aug 21 2020, 06:29
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/abc_mining_basic.py
58 ↗(On Diff #22994)

This assumes there is no transaction nor halving occurring. Either put a comment to state that the block reward from getblocktemplate is not related to the one from the current tip, or find a more accurate way to express the constraint you want to test.

66 ↗(On Diff #22994)

> 1 is more accurate

73 ↗(On Diff #22994)

Dito

This revision now requires changes to proceed.Aug 21 2020, 06:29
test/functional/abc_mining_basic.py
58 ↗(On Diff #22994)

A little of both won't hurt :)

66 ↗(On Diff #22994)

Good catch

Improve test robustness according to feedback

This revision is now accepted and ready to land.Aug 24 2020, 06:39