diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-02-07 11:26:05 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-05-07 15:40:47 +0200 |
commit | fa826db477a981b48bff53021f9695a5f6682dc0 (patch) | |
tree | d59bf15566475700a29b85317f8b9aabddc40e82 /contrib/signet/miner | |
parent | faf2a975ad46799d075e3a70c699da0d8182aab9 (diff) | |
download | bitcoin-fa826db477a981b48bff53021f9695a5f6682dc0.tar.xz |
scripted-diff: test: Use int.to_bytes over struct packing
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended 's!struct.pack\(.<?B., (.*)\)!\1.to_bytes(1, "little")!g' $( git grep -l struct.pack )
sed -i --regexp-extended 's!struct.pack\(.<I., (.*)\)!\1.to_bytes(4, "little")!g' $( git grep -l struct.pack )
sed -i --regexp-extended 's!struct.pack\(.<H., (.*)\)!\1.to_bytes(2, "little")!g' $( git grep -l struct.pack )
sed -i --regexp-extended 's!struct.pack\(.<i., (.*)\)!\1.to_bytes(4, "little", signed=True)!g' $( git grep -l struct.pack )
sed -i --regexp-extended 's!struct.pack\(.<q., (.*)\)!\1.to_bytes(8, "little", signed=True)!g' $( git grep -l struct.pack )
sed -i --regexp-extended 's!struct.pack\(.>H., (.*)\)!\1.to_bytes(2, "big")!g' $( git grep -l struct.pack )
-END VERIFY SCRIPT-
Diffstat (limited to 'contrib/signet/miner')
-rwxr-xr-x | contrib/signet/miner | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/signet/miner b/contrib/signet/miner index e5daf9f993..7b7b3feb39 100755 --- a/contrib/signet/miner +++ b/contrib/signet/miner @@ -52,10 +52,10 @@ def signet_txs(block, challenge): mroot = block.get_merkle_root(hashes) sd = b"" - sd += struct.pack("<i", block.nVersion) + sd += block.nVersion.to_bytes(4, "little", signed=True) sd += ser_uint256(block.hashPrevBlock) sd += ser_uint256(mroot) - sd += struct.pack("<I", block.nTime) + sd += block.nTime.to_bytes(4, "little") to_spend = CTransaction() to_spend.nVersion = 0 |