mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 16:31:29 +00:00
fix: update commands with new transaction constructors
This commit is contained in:
parent
597dd49e8c
commit
24f40f610f
1 changed files with 8 additions and 8 deletions
|
@ -162,20 +162,20 @@ class Commands:
|
||||||
i['prevout_hash'] = i['txid']
|
i['prevout_hash'] = i['txid']
|
||||||
i['prevout_n'] = i['vout']
|
i['prevout_n'] = i['vout']
|
||||||
outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items())
|
outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items())
|
||||||
tx = Transaction.from_io(inputs, outputs)
|
tx = Transaction(inputs, outputs)
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
def signrawtransaction(self, raw_tx, private_keys):
|
def signrawtransaction(self, raw_tx, private_keys):
|
||||||
tx = Transaction(raw_tx)
|
tx = Transaction.deserialize(raw_tx)
|
||||||
self.wallet.signrawtransaction(tx, private_keys, self.password)
|
self.wallet.signrawtransaction(tx, private_keys, self.password)
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
def decoderawtransaction(self, raw):
|
def decoderawtransaction(self, raw):
|
||||||
tx = Transaction(raw)
|
tx = Transaction.deserialize(raw)
|
||||||
return tx.deserialize()
|
return {'inputs':tx.inputs, 'outputs':tx.outputs}
|
||||||
|
|
||||||
def sendrawtransaction(self, raw):
|
def sendrawtransaction(self, raw):
|
||||||
tx = Transaction(raw)
|
tx = Transaction.deserialize(raw)
|
||||||
return self.network.synchronous_get([('blockchain.transaction.broadcast', [str(tx)])])[0]
|
return self.network.synchronous_get([('blockchain.transaction.broadcast', [str(tx)])])[0]
|
||||||
|
|
||||||
def createmultisig(self, num, pubkeys):
|
def createmultisig(self, num, pubkeys):
|
||||||
|
@ -375,9 +375,9 @@ class Commands:
|
||||||
if tx:
|
if tx:
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
r = self.network.synchronous_get([ ('blockchain.transaction.get',[tx_hash]) ])[0]
|
raw = self.network.synchronous_get([ ('blockchain.transaction.get',[tx_hash]) ])[0]
|
||||||
if r:
|
if raw:
|
||||||
return Transaction(r)
|
return Transaction.deserialize(raw)
|
||||||
else:
|
else:
|
||||||
return "unknown transaction"
|
return "unknown transaction"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue