Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QA] remove some magic mining constants in functional tests #15238

Merged
merged 2 commits into from Feb 12, 2019

Conversation

@instagibbs
Copy link
Member

@instagibbs instagibbs commented Jan 23, 2019

The fewer magic numbers the better.

Also more directly tested a submitheader case of bad previous blockhash.

@instagibbs instagibbs changed the title remove some magic mining constants in functional tests [QA] remove some magic mining constants in functional tests Jan 23, 2019
@fanquake fanquake added the Tests label Jan 23, 2019
test/functional/interface_rest.py Outdated Show resolved Hide resolved
@instagibbs instagibbs force-pushed the magic_miner branch 2 times, most recently from 15b0e3c to d37b1c3 Jan 24, 2019
@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Jan 24, 2019

utACK b651ef7

@Empact
Copy link
Member

@Empact Empact commented Jan 25, 2019

utACK b651ef7

MarcoFalke added a commit to MarcoFalke/bitcoin-core that referenced this issue Feb 12, 2019
…ional tests

b651ef7 submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
@MarcoFalke MarcoFalke merged commit b651ef7 into bitcoin:master Feb 12, 2019
2 checks passed
@@ -15,6 +15,7 @@
from test_framework.messages import (
CBlock,
CBlockHeader,
BLOCK_HEADER_SIZE
Copy link
Member

@MarcoFalke MarcoFalke Feb 12, 2019

style-nit: Missing trailing , 👀

assert_raises_rpc_error(-25, 'Must submit previous header', lambda: node.submitheader(hexdata='ff' * 80))
assert_raises_rpc_error(-22, 'Block header decode failed', lambda: node.submitheader(hexdata='xx' * BLOCK_HEADER_SIZE))
assert_raises_rpc_error(-22, 'Block header decode failed', lambda: node.submitheader(hexdata='ff' * (BLOCK_HEADER_SIZE-2)))
assert_raises_rpc_error(-25, 'Must submit previous header', lambda: node.submitheader(hexdata=super(CBlock, bad_block).serialize().hex()))
Copy link
Contributor

@AkioNak AkioNak Feb 18, 2019

Currentry, minimum required version of Python (test) is 3.4.
https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md

But hex() seems to be introdued in Python 3.5.
https://docs.python.org/3.5/library/stdtypes.html?highlight=bytes%20hex#bytes.hex

I got following error when executing this test on Python3.4.

AttributeError: 'bytes' object has no attribute 'hex'

@Sjors
Copy link
Member

@Sjors Sjors commented Feb 20, 2019

This test also fails for me locally on Python 3.4. If you install PyEnv it will catch this.

Fixed in #15439

deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Oct 2, 2020
Summary: Backport of Core [[bitcoin/bitcoin#15238 | PR15238]]

Test Plan: `ninja && ./test/functional/test_runner.py interface_rest mining_basic`

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7714
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…ional tests

b651ef7 submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…ional tests

b651ef7 submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 13, 2021
…ional tests

b651ef7 submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 13, 2021
…ional tests

b651ef7 submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants