From 0c6a908f7c4df3e3a5940b4abea80a3b11157a9a Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Thu, 7 Feb 2019 17:42:33 -0800 Subject: [PATCH] Fixed all rpc test cases. --- src/chainparams.cpp | 8 ++++---- test/functional/rpc_fundrawtransaction.py | 8 ++++---- test/functional/rpc_rawtransaction.py | 6 +++--- test/functional/rpc_signmessage.py | 2 +- test/functional/rpc_txoutproof.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f8cbb37a0..191cee44d 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -282,10 +282,10 @@ public: // By default assume that the signatures in ancestors of this block are valid. consensus.defaultAssumeValid = uint256S("0x00"); - pchMessageStart[0] = 0xe3; - pchMessageStart[1] = 0x0c; - pchMessageStart[2] = 0x1a; - pchMessageStart[3] = 0x2f; + pchMessageStart[0] = 0xfa; + pchMessageStart[1] = 0xbf; + pchMessageStart[2] = 0xb5; + pchMessageStart[3] = 0xda; nDefaultPort = 19444; nPruneAfterHeight = 1000; diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index 79b8ac762..69f7c895c 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -48,13 +48,13 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() # ensure that setting changePosition in fundraw with an exact match is handled properly - rawmatch = self.nodes[2].createrawtransaction([], {self.nodes[2].getnewaddress():50}) + rawmatch = self.nodes[2].createrawtransaction([], {self.nodes[2].getnewaddress():500}) rawmatch = self.nodes[2].fundrawtransaction(rawmatch, {"changePosition":1, "subtractFeeFromOutputs":[0]}) assert_equal(rawmatch["changepos"], -1) watchonly_address = self.nodes[0].getnewaddress() watchonly_pubkey = self.nodes[0].validateaddress(watchonly_address)["pubkey"] - watchonly_amount = Decimal(200) + watchonly_amount = Decimal(2000) self.nodes[3].importpubkey(watchonly_pubkey, "", True) watchonly_txid = self.nodes[0].sendtoaddress(watchonly_address, watchonly_amount) self.nodes[0].sendtoaddress(self.nodes[3].getnewaddress(), watchonly_amount / 10) @@ -506,7 +506,7 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() # make sure funds are received at node1 - assert_equal(oldBalance+Decimal('51.10000000'), self.nodes[0].getbalance()) + assert_equal(oldBalance+Decimal('501.10000000'), self.nodes[0].getbalance()) ############################################### @@ -566,7 +566,7 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() self.nodes[0].generate(1) self.sync_all() - assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()) #0.19+block reward + assert_equal(oldBalance+Decimal('500.19000000'), self.nodes[0].getbalance()) #0.19+block reward ##################################################### # test fundrawtransaction with OP_RETURN and no vin # diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index c77e8648e..7f1f9819e 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -85,7 +85,7 @@ class RawTransactionsTest(BitcoinTestFramework): address = self.nodes[0].getnewaddress() assert_raises_rpc_error(-3, "Expected type object", self.nodes[0].createrawtransaction, [], 'foo') assert_raises_rpc_error(-8, "Data must be hexadecimal string", self.nodes[0].createrawtransaction, [], {'data': 'foo'}) - assert_raises_rpc_error(-5, "Invalid Kevacoin address", self.nodes[0].createrawtransaction, [], {'foo': 0}) + assert_raises_rpc_error(-5, "Invalid kevacoin address", self.nodes[0].createrawtransaction, [], {'foo': 0}) assert_raises_rpc_error(-3, "Invalid amount", self.nodes[0].createrawtransaction, [], {address: 'foo'}) assert_raises_rpc_error(-3, "Amount out of range", self.nodes[0].createrawtransaction, [], {address: -1}) assert_raises_rpc_error(-8, "Invalid parameter, duplicated address: %s" % address, self.nodes[0].createrawtransaction, [], multidict([(address, 1), (address, 1)])) @@ -263,7 +263,7 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() self.nodes[0].generate(1) self.sync_all() - assert_equal(self.nodes[0].getbalance(), bal+Decimal('50.00000000')+Decimal('2.19000000')) #block reward + tx + assert_equal(self.nodes[0].getbalance(), bal+Decimal('500.00000000')+Decimal('2.19000000')) #block reward + tx # 2of2 test for combining transactions bal = self.nodes[2].getbalance() @@ -312,7 +312,7 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() self.nodes[0].generate(1) self.sync_all() - assert_equal(self.nodes[0].getbalance(), bal+Decimal('50.00000000')+Decimal('2.19000000')) #block reward + tx + assert_equal(self.nodes[0].getbalance(), bal+Decimal('500.00000000')+Decimal('2.19000000')) #block reward + tx # decoderawtransaction tests # witness transaction diff --git a/test/functional/rpc_signmessage.py b/test/functional/rpc_signmessage.py index ca77b77c5..a03dad47c 100755 --- a/test/functional/rpc_signmessage.py +++ b/test/functional/rpc_signmessage.py @@ -19,7 +19,7 @@ class SignMessagesTest(BitcoinTestFramework): self.log.info('test signing with priv_key') priv_key = 'cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N' address = 'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB' - expected_signature = 'IGve8AOjIcu+a/nYW1PABSfmp2oQlEqLIOwPgNW5/Y5teggr8S0vy4SMdjL2Viv3iuBZjJbhvyBo0tv5m3H63b8=' + expected_signature = 'IAbLaZ5ZuYSQGPpCxxiLFWmZC19TlTy9BGdAfQqRlzhKfe0OqcEYiWgmB/Pc67JF4EN87MBUUbIiH4ndR30uU+w=' signature = self.nodes[0].signmessagewithprivkey(priv_key, message) assert_equal(expected_signature, signature) assert(self.nodes[0].verifymessage(address, signature, message)) diff --git a/test/functional/rpc_txoutproof.py b/test/functional/rpc_txoutproof.py index d35cc2751..851c544be 100755 --- a/test/functional/rpc_txoutproof.py +++ b/test/functional/rpc_txoutproof.py @@ -35,9 +35,9 @@ class MerkleBlockTest(BitcoinTestFramework): assert_equal(self.nodes[2].getbalance(), 0) node0utxos = self.nodes[0].listunspent(1) - tx1 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 49.99}) + tx1 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 499.99}) txid1 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx1)["hex"]) - tx2 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 49.99}) + tx2 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 499.99}) txid2 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx2)["hex"]) # This will raise an exception because the transaction is not yet in a block assert_raises_rpc_error(-5, "Transaction not yet in block", self.nodes[0].gettxoutproof, [txid1]) @@ -56,7 +56,7 @@ class MerkleBlockTest(BitcoinTestFramework): assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1, txid2], blockhash)), txlist) txin_spent = self.nodes[1].listunspent(1).pop() - tx3 = self.nodes[1].createrawtransaction([txin_spent], {self.nodes[0].getnewaddress(): 49.98}) + tx3 = self.nodes[1].createrawtransaction([txin_spent], {self.nodes[0].getnewaddress(): 499.98}) txid3 = self.nodes[0].sendrawtransaction(self.nodes[1].signrawtransaction(tx3)["hex"]) self.nodes[0].generate(1) self.sync_all()