Don't reverse 32-byte transactions in Zcash output
This commit is contained in:
parent
9448eeeee5
commit
07b7a6e8d8
|
@ -43,7 +43,7 @@ def tv_json(filename, parts, vectors, bitcoin_flavoured):
|
||||||
', '.join([p[0] for p in parts])
|
', '.join([p[0] for p in parts])
|
||||||
))
|
))
|
||||||
print(' ' + ',\n '.join([
|
print(' ' + ',\n '.join([
|
||||||
json.dumps([tv_value_json(v[p[0]], bitcoin_flavoured) for p in parts]) for v in vectors
|
json.dumps([tv_value_json(v[p[0]], p[1].get('bitcoin_flavoured', bitcoin_flavoured)) for p in parts]) for v in vectors
|
||||||
]))
|
]))
|
||||||
print(']')
|
print(']')
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ def tv_part_rust(name, value, indent=3):
|
||||||
|
|
||||||
def tv_rust(filename, parts, vectors):
|
def tv_rust(filename, parts, vectors):
|
||||||
print(' struct TestVector {')
|
print(' struct TestVector {')
|
||||||
for p in parts: print(' %s: %s,' % p)
|
for p in parts: print(' %s: %s,' % (p[0], p[1]['rust']))
|
||||||
print(''' };
|
print(''' };
|
||||||
|
|
||||||
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/%s.py''' % (
|
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/%s.py''' % (
|
||||||
|
@ -124,6 +124,9 @@ def render_args():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def render_tv(args, filename, parts, vectors):
|
def render_tv(args, filename, parts, vectors):
|
||||||
|
# Convert older format
|
||||||
|
parts = [(p[0], p[1] if type(p[1]) == type({}) else {'rust': p[1]}) for p in parts]
|
||||||
|
|
||||||
if args.target == 'rust':
|
if args.target == 'rust':
|
||||||
tv_rust(filename, parts, vectors)
|
tv_rust(filename, parts, vectors)
|
||||||
elif args.target == 'zcash':
|
elif args.target == 'zcash':
|
||||||
|
|
|
@ -149,7 +149,7 @@ def main():
|
||||||
args,
|
args,
|
||||||
'zip_0143',
|
'zip_0143',
|
||||||
(
|
(
|
||||||
('tx', 'Vec<u8>'),
|
('tx', {'rust': 'Vec<u8>', 'bitcoin_flavoured': False}),
|
||||||
('scriptCode', 'Vec<u8>'),
|
('scriptCode', 'Vec<u8>'),
|
||||||
('nIn', 'u32'),
|
('nIn', 'u32'),
|
||||||
('nHashType', 'u32'),
|
('nHashType', 'u32'),
|
||||||
|
|
Loading…
Reference in New Issue