|
|
@ -322,8 +322,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
#compare fee of a standard pubkeyhash transaction |
|
|
|
#compare fee of a standard pubkeyhash transaction |
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1} |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1} |
|
|
|
rawTx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#create same transaction over sendtoaddress |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
txId = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1.1) |
|
|
|
txId = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1.1) |
|
|
@ -338,8 +338,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
#compare fee of a standard pubkeyhash transaction with multiple outputs |
|
|
|
#compare fee of a standard pubkeyhash transaction with multiple outputs |
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1,self.nodes[1].getnewaddress():1.2,self.nodes[1].getnewaddress():0.1,self.nodes[1].getnewaddress():1.3,self.nodes[1].getnewaddress():0.2,self.nodes[1].getnewaddress():0.3} |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1,self.nodes[1].getnewaddress():1.2,self.nodes[1].getnewaddress():0.1,self.nodes[1].getnewaddress():1.3,self.nodes[1].getnewaddress():0.2,self.nodes[1].getnewaddress():0.3} |
|
|
|
rawTx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawtx) |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
txId = self.nodes[0].sendmany("", outputs) |
|
|
|
txId = self.nodes[0].sendmany("", outputs) |
|
|
|
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee'] |
|
|
|
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee'] |
|
|
@ -364,8 +364,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
|
|
|
|
|
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {mSigObj:1.1} |
|
|
|
outputs = {mSigObj:1.1} |
|
|
|
rawTx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#create same transaction over sendtoaddress |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1) |
|
|
|
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1) |
|
|
@ -397,8 +397,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
|
|
|
|
|
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {mSigObj:1.1} |
|
|
|
outputs = {mSigObj:1.1} |
|
|
|
rawTx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[0].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[0].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#create same transaction over sendtoaddress |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1) |
|
|
|
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1) |
|
|
@ -432,8 +432,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
oldBalance = self.nodes[1].getbalance() |
|
|
|
oldBalance = self.nodes[1].getbalance() |
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1} |
|
|
|
outputs = {self.nodes[1].getnewaddress():1.1} |
|
|
|
rawTx = self.nodes[2].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[2].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[2].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[2].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
signedTx = self.nodes[2].signrawtransaction(fundedTx['hex']) |
|
|
|
signedTx = self.nodes[2].signrawtransaction(fundedTx['hex']) |
|
|
|
txId = self.nodes[2].sendrawtransaction(signedTx['hex']) |
|
|
|
txId = self.nodes[2].sendrawtransaction(signedTx['hex']) |
|
|
@ -469,10 +469,10 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
self.nodes[1].getnewaddress() |
|
|
|
self.nodes[1].getnewaddress() |
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[0].getnewaddress():1.1} |
|
|
|
outputs = {self.nodes[0].getnewaddress():1.1} |
|
|
|
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
# fund a transaction that requires a new key for the change output |
|
|
|
# fund a transaction that requires a new key for the change output |
|
|
|
# creating the key must be impossible because the wallet is locked |
|
|
|
# creating the key must be impossible because the wallet is locked |
|
|
|
assert_raises_jsonrpc(-4, "Keypool ran out, please call keypoolrefill first", self.nodes[1].fundrawtransaction, rawTx) |
|
|
|
assert_raises_jsonrpc(-4, "Keypool ran out, please call keypoolrefill first", self.nodes[1].fundrawtransaction, rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#refill the keypool |
|
|
|
#refill the keypool |
|
|
|
self.nodes[1].walletpassphrase("test", 100) |
|
|
|
self.nodes[1].walletpassphrase("test", 100) |
|
|
@ -484,8 +484,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
|
|
|
|
|
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[0].getnewaddress():1.1} |
|
|
|
outputs = {self.nodes[0].getnewaddress():1.1} |
|
|
|
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#now we need to unlock |
|
|
|
#now we need to unlock |
|
|
|
self.nodes[1].walletpassphrase("test", 600) |
|
|
|
self.nodes[1].walletpassphrase("test", 600) |
|
|
@ -516,8 +516,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
#fund a tx with ~20 small inputs |
|
|
|
#fund a tx with ~20 small inputs |
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04} |
|
|
|
outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04} |
|
|
|
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawtx) |
|
|
|
|
|
|
|
|
|
|
|
#create same transaction over sendtoaddress |
|
|
|
#create same transaction over sendtoaddress |
|
|
|
txId = self.nodes[1].sendmany("", outputs) |
|
|
|
txId = self.nodes[1].sendmany("", outputs) |
|
|
@ -548,8 +548,8 @@ class RawTransactionsTest(BitcoinTestFramework): |
|
|
|
|
|
|
|
|
|
|
|
inputs = [] |
|
|
|
inputs = [] |
|
|
|
outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04} |
|
|
|
outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04} |
|
|
|
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawTx) |
|
|
|
fundedTx = self.nodes[1].fundrawtransaction(rawtx) |
|
|
|
fundedAndSignedTx = self.nodes[1].signrawtransaction(fundedTx['hex']) |
|
|
|
fundedAndSignedTx = self.nodes[1].signrawtransaction(fundedTx['hex']) |
|
|
|
txId = self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex']) |
|
|
|
txId = self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex']) |
|
|
|
self.sync_all() |
|
|
|
self.sync_all() |
|
|
|