Skip to content

Conversation

@instagibbs
Copy link
Member

No description provided.

@fanquake fanquake added the Tests label Mar 25, 2019
Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

Concept ACK moving to segwit being the default for the test framework.

Your additional code in mining_basic is testing that the test framework can deserialize and then serialize a block (ie block_hex = serialize(deserialize(block_hex))). I don't think tests of the test framework belong in the individual test cases. Those are supposed to be testing the node.

I'd just drop the changes to mining_basic.py.

@instagibbs
Copy link
Member Author

@jnewbery do we have a place to self-test python serialization/utility code? I've added this before to other tests. I can drop it here for now.

@jnewbery
Copy link
Contributor

do we have a place to self-test python serialization/utility code?

We don't. I don't think it's worth it to be honest. The python code is pretty simple.

If we did add it, I'd suggest adding it to /test/functional/test_framework/ and using Python's unittest module. But again, I don't think it's worthwhile.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Could also remove some bloat with a scripted diff:

sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert(block.serialize(with_witness=False).hex() != block_hex)
assert block.serialize(with_witness=False).hex() != block_hex

@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@bitcoin bitcoin deleted a comment from Stivovo Apr 2, 2019
@instagibbs instagibbs changed the title change default Python block serialization to witness, test round-trip change default Python block serialization to witness Apr 2, 2019
@instagibbs
Copy link
Member Author

removed round-trip test

@stevenroose
Copy link
Contributor

ACK 124ea38

@maflcko maflcko merged commit 124ea38 into bitcoin:master May 8, 2019
maflcko pushed a commit that referenced this pull request May 8, 2019
124ea38 change default Python block serialization to witness (Gregory Sanders)

Pull request description:

ACKs for commit 124ea3:
  stevenroose:
    ACK 124ea38

Tree-SHA512: 52877934f8a3c761cb89a618daffe73e86b008d9d32d48721392b7626aaa10d3b9aa26e4c59337729e0a2d01fc48648eef5ec3d72de531a685a2cf4f4d7579ab
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 8, 2019
Unnamed arguments are confusing as to what they mean without looking up
the function signature.

Since segwit is active by default in regtest, and all blocks are
serialized with witness (bitcoin#15664, c459c5f), remove the argument
`with_witness=True` from all calls to `CBlock::serialize` and
`BlockTransactions::serialize`.

This diff has been created with a script, but is better reviewed without
a scripted diff.

sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 8, 2019
…ness

124ea38 change default Python block serialization to witness (Gregory Sanders)

Pull request description:

ACKs for commit 124ea3:
  stevenroose:
    ACK 124ea38

Tree-SHA512: 52877934f8a3c761cb89a618daffe73e86b008d9d32d48721392b7626aaa10d3b9aa26e4c59337729e0a2d01fc48648eef5ec3d72de531a685a2cf4f4d7579ab
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Jun 17, 2019
fa1d766 tests: Make msg_block a witness block (MarcoFalke)
fa52eb5 test: Remove True argument to CBlock::serialize (MarcoFalke)

Pull request description:

  Unnamed arguments are confusing as to what they mean without looking up the function signature.

  Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`.

ACKs for commit fa1d76:
  laanwj:
    code-review ACK fa1d766

Tree-SHA512: 2c550646f99c9ca86a223ca988c61a730f5e6646807adeaa7174fb2424a32cea3fef8bcd3e0b12e162e7ff192877d0c02fd0654df6ee1a9b821b065707c2dcbc
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 19, 2019
fa1d766 tests: Make msg_block a witness block (MarcoFalke)
fa52eb5 test: Remove True argument to CBlock::serialize (MarcoFalke)

Pull request description:

  Unnamed arguments are confusing as to what they mean without looking up the function signature.

  Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`.

ACKs for commit fa1d76:
  laanwj:
    code-review ACK fa1d766

Tree-SHA512: 2c550646f99c9ca86a223ca988c61a730f5e6646807adeaa7174fb2424a32cea3fef8bcd3e0b12e162e7ff192877d0c02fd0654df6ee1a9b821b065707c2dcbc
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 30, 2019
Unnamed arguments are confusing as to what they mean without looking up
the function signature.

Since segwit is active by default in regtest, and all blocks are
serialized with witness (bitcoin#15664, c459c5f), remove the argument
`with_witness=True` from all calls to `CBlock::serialize` and
`BlockTransactions::serialize`.

This diff has been created with a script, but is better reviewed without
a scripted diff.

sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants