Only generate valueBalance and bindingSig for v4+ transactions

Reverts a change to the ZIP 143 test vectors caused by #9.
This commit is contained in:
Jack Grigg 2019-02-22 22:16:56 +00:00
parent 196c317d89
commit 281dc5b0c8
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
1 changed files with 4 additions and 2 deletions

View File

@ -221,7 +221,8 @@ class Transaction(object):
self.nLockTime = rand.u32()
self.nExpiryHeight = rand.u32() % TX_EXPIRY_HEIGHT_THRESHOLD
self.valueBalance = rand.u64() % (MAX_MONEY + 1)
if self.nVersion >= SAPLING_TX_VERSION:
self.valueBalance = rand.u64() % (MAX_MONEY + 1)
self.vShieldedSpends = []
self.vShieldedOutputs = []
@ -239,7 +240,8 @@ class Transaction(object):
self.joinSplitPubKey = rand.b(32) # Potentially invalid
self.joinSplitSig = rand.b(64) # Invalid
self.bindingSig = rand.b(64) # Invalid
if self.nVersion >= SAPLING_TX_VERSION:
self.bindingSig = rand.b(64) # Invalid
def header(self):
return self.nVersion | (1 << 31 if self.fOverwintered else 0)