Skip to content

Commit 9817426

Browse files
committed
fixes
checked the actual dump which is different from Core's utxo dump. First coint has heightAndIsCoinbase = 0x81 0x80 is the same height with different isCoinbase 0x83 is a different height with same isCoinbase Also the excessive amount test didn't work because the offset was wrong, see commit message bitcoin/bitcoin@e5ff4e4 > In addition, the undocumented offset is set surprisingly high (39 bytes is well into the > serialization of the amount which starts at offset 36). The values 39 and 36 are after core#29612 (Optimize dumptxoutset output), so they translate to 41 & 38 for us.
1 parent 60b86d1 commit 9817426

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

test/functional/feature_assumeutxo.py

+16-17
Original file line numberDiff line numberDiff line change
@@ -125,36 +125,35 @@ def expected_error(log_msg="", rpc_details=""):
125125
"3872c8e52554070ca410faff98e42f63c99d08f536be343af7c04143e0e8f2b2",
126126
None,
127127
],
128-
# fIXME:
129-
# # wrong coin code VARINT((coinbase ? 1 : 0) | (height << 1))
130-
# [
131-
# b"\x81",
132-
# 36,
133-
# "d631a0dbf1bba8536d1dd7aba0881a0ad83bdb4a8502f53fec8b89c549659633",
134-
# None,
135-
# ],
136-
# another wrong coin code
128+
# wrong coin code VARINT((coinbase ? 1 : 0) | (height << 1))
129+
# We expect b"\x81" (as seen in a dump of valid_snapshot_path)
137130
[
138131
b"\x80",
139132
36,
140133
"b14c9595737179fe57e6d7a9f8e879a440833fa95ba52d210f1f7e3c02be64b2",
141134
None,
142135
],
136+
# another wrong coin code
137+
[
138+
b"\x83",
139+
36,
140+
"296b4acd0d41dd4c0e845a7ed0cbdc602e5a7d092d5b4948a72835d2158f1e8e",
141+
None,
142+
],
143143
# wrong coin case with height 364 and coinbase 0
144144
[
145145
b"\x84\x58",
146146
36,
147147
None,
148148
"[snapshot] bad snapshot data after deserializing 0 coins",
149149
],
150-
# FIXME: ???? does not trigger the correct error
151-
# # Amount exceeds MAX_MONEY
152-
# [
153-
# b"\xCA\xD2\x8F\x5A",
154-
# 41,
155-
# None,
156-
# "[snapshot] bad snapshot data after deserializing 0 coins - bad tx out value",
157-
# ],
150+
# Amount exceeds MAX_MONEY
151+
[
152+
b"\xCA\xD2\x8F\x5A",
153+
38,
154+
None,
155+
"[snapshot] bad snapshot data after deserializing 0 coins - bad tx out value",
156+
],
158157
]
159158

160159
for content, offset, wrong_hash, custom_message in cases:

0 commit comments

Comments
 (0)