]> Git Repo - VerusCoin.git/commitdiff
Update qa test to check for Sapling related JSON fields.
authorSimon <[email protected]>
Mon, 17 Sep 2018 17:01:50 +0000 (10:01 -0700)
committerSimon <[email protected]>
Mon, 17 Sep 2018 17:01:50 +0000 (10:01 -0700)
qa/rpc-tests/wallet_sapling.py

index 517869820cb7e651952684a97e761c6f7980bf40..0ce1c734f65e430f0dd93cb65c0d329883dbd0f9 100755 (executable)
@@ -89,7 +89,7 @@ class WalletSaplingTest(BitcoinTestFramework):
         recipients.append({"address": saplingAddr0, "amount": Decimal('5')})
         recipients.append({"address": taddr1, "amount": Decimal('5')})
         myopid = self.nodes[1].z_sendmany(saplingAddr1, recipients, 1, 0)
-        wait_and_assert_operationid_status(self.nodes[1], myopid)
+        mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
 
         self.sync_all()
         self.nodes[2].generate(1)
@@ -100,5 +100,26 @@ class WalletSaplingTest(BitcoinTestFramework):
         assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('5'))
         assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('5'))
 
+        # Verify existence of Sapling related JSON fields
+        resp = self.nodes[0].getrawtransaction(mytxid, 1)
+        assert_equal(resp['valueBalance'], Decimal('5'))
+        assert(len(resp['vShieldedSpend']) == 1)
+        assert(len(resp['vShieldedOutput']) == 2)
+        assert('bindingSig' in resp)
+        shieldedSpend = resp['vShieldedSpend'][0]
+        assert('cv' in shieldedSpend)
+        assert('anchor' in shieldedSpend)
+        assert('nullifier' in shieldedSpend)
+        assert('rk' in shieldedSpend)
+        assert('proof' in shieldedSpend)
+        assert('spendAuthSig' in shieldedSpend)
+        shieldedOutput = resp['vShieldedOutput'][0]
+        assert('cv' in shieldedOutput)
+        assert('cmu' in shieldedOutput)
+        assert('ephemeralKey' in shieldedOutput)
+        assert('encCiphertext' in shieldedOutput)
+        assert('outCiphertext' in shieldedOutput)
+        assert('proof' in shieldedOutput)
+
 if __name__ == '__main__':
     WalletSaplingTest().main()
This page took 0.026993 seconds and 4 git commands to generate.