-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] added createrawtransaction rpc #862
Draft
tomt1664
wants to merge
1
commit into
ElementsProject:master
Choose a base branch
from
tomt1664:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<!DOCTYPE RCC><RCC version="1.0"> | ||
<qresource prefix="/icons"> | ||
<file alias="bitcoin">res/rendered_icons/bitcoin1024.png</file> | ||
<file alias="address-book">res/icons/address-book.png</file> | ||
<file alias="quit">res/icons/quit.png</file> | ||
<file alias="send">res/icons/send.png</file> | ||
<file alias="connect_0">res/icons/connect0.png</file> | ||
<file alias="connect_1">res/icons/connect1.png</file> | ||
<file alias="connect_2">res/icons/connect2.png</file> | ||
<file alias="connect_3">res/icons/connect3.png</file> | ||
<file alias="connect_4">res/icons/connect4.png</file> | ||
<file alias="transaction_0">res/icons/transaction0.png</file> | ||
<file alias="transaction_confirmed">res/icons/transaction2.png</file> | ||
<file alias="transaction_conflicted">res/icons/transaction_conflicted.png</file> | ||
<file alias="transaction_1">res/icons/clock1.png</file> | ||
<file alias="transaction_2">res/icons/clock2.png</file> | ||
<file alias="transaction_3">res/icons/clock3.png</file> | ||
<file alias="transaction_4">res/icons/clock4.png</file> | ||
<file alias="transaction_5">res/icons/clock5.png</file> | ||
<file alias="eye">res/icons/eye.png</file> | ||
<file alias="eye_minus">res/icons/eye_minus.png</file> | ||
<file alias="eye_plus">res/icons/eye_plus.png</file> | ||
<file alias="options">res/icons/configure.png</file> | ||
<file alias="receiving_addresses">res/icons/receive.png</file> | ||
<file alias="editpaste">res/icons/editpaste.png</file> | ||
<file alias="editcopy">res/icons/editcopy.png</file> | ||
<file alias="add">res/icons/add.png</file> | ||
<file alias="edit">res/icons/edit.png</file> | ||
<file alias="history">res/icons/history.png</file> | ||
<file alias="overview">res/icons/overview.png</file> | ||
<file alias="export">res/icons/export.png</file> | ||
<file alias="synced">res/icons/synced.png</file> | ||
<file alias="remove">res/icons/remove.png</file> | ||
<file alias="tx_mined">res/icons/tx_mined.png</file> | ||
<file alias="tx_input">res/icons/tx_input.png</file> | ||
<file alias="tx_output">res/icons/tx_output.png</file> | ||
<file alias="tx_inout">res/icons/tx_inout.png</file> | ||
<file alias="lock_closed">res/icons/lock_closed.png</file> | ||
<file alias="lock_open">res/icons/lock_open.png</file> | ||
<file alias="key">res/icons/key.png</file> | ||
<file alias="filesave">res/icons/filesave.png</file> | ||
<file alias="debugwindow">res/icons/debugwindow.png</file> | ||
<file alias="open">res/icons/open.png</file> | ||
<file alias="info">res/icons/info.png</file> | ||
<file alias="about">res/rendered_icons/about.png</file> | ||
<file alias="about_qt">res/icons/about_qt.png</file> | ||
<file alias="verify">res/icons/verify.png</file> | ||
<file alias="warning">res/icons/warning.png</file> | ||
<file alias="fontbigger">res/icons/fontbigger.png</file> | ||
<file alias="fontsmaller">res/icons/fontsmaller.png</file> | ||
<file alias="prompticon">res/icons/chevron.png</file> | ||
<file alias="transaction_abandoned">res/icons/transaction_abandoned.png</file> | ||
<file alias="hd_enabled">res/icons/hd_enabled.png</file> | ||
<file alias="hd_disabled">res/icons/hd_disabled.png</file> | ||
<file alias="network_disabled">res/icons/network_disabled.png</file> | ||
<file alias="proxy">res/icons/proxy.png</file> | ||
</qresource> | ||
<qresource prefix="/movies"> | ||
<file alias="spinner-000">res/movies/spinner-000.png</file> | ||
<file alias="spinner-001">res/movies/spinner-001.png</file> | ||
<file alias="spinner-002">res/movies/spinner-002.png</file> | ||
<file alias="spinner-003">res/movies/spinner-003.png</file> | ||
<file alias="spinner-004">res/movies/spinner-004.png</file> | ||
<file alias="spinner-005">res/movies/spinner-005.png</file> | ||
<file alias="spinner-006">res/movies/spinner-006.png</file> | ||
<file alias="spinner-007">res/movies/spinner-007.png</file> | ||
<file alias="spinner-008">res/movies/spinner-008.png</file> | ||
<file alias="spinner-009">res/movies/spinner-009.png</file> | ||
<file alias="spinner-010">res/movies/spinner-010.png</file> | ||
<file alias="spinner-011">res/movies/spinner-011.png</file> | ||
<file alias="spinner-012">res/movies/spinner-012.png</file> | ||
<file alias="spinner-013">res/movies/spinner-013.png</file> | ||
<file alias="spinner-014">res/movies/spinner-014.png</file> | ||
<file alias="spinner-015">res/movies/spinner-015.png</file> | ||
<file alias="spinner-016">res/movies/spinner-016.png</file> | ||
<file alias="spinner-017">res/movies/spinner-017.png</file> | ||
<file alias="spinner-018">res/movies/spinner-018.png</file> | ||
<file alias="spinner-019">res/movies/spinner-019.png</file> | ||
<file alias="spinner-020">res/movies/spinner-020.png</file> | ||
<file alias="spinner-021">res/movies/spinner-021.png</file> | ||
<file alias="spinner-022">res/movies/spinner-022.png</file> | ||
<file alias="spinner-023">res/movies/spinner-023.png</file> | ||
<file alias="spinner-024">res/movies/spinner-024.png</file> | ||
<file alias="spinner-025">res/movies/spinner-025.png</file> | ||
<file alias="spinner-026">res/movies/spinner-026.png</file> | ||
<file alias="spinner-027">res/movies/spinner-027.png</file> | ||
<file alias="spinner-028">res/movies/spinner-028.png</file> | ||
<file alias="spinner-029">res/movies/spinner-029.png</file> | ||
<file alias="spinner-030">res/movies/spinner-030.png</file> | ||
<file alias="spinner-031">res/movies/spinner-031.png</file> | ||
<file alias="spinner-032">res/movies/spinner-032.png</file> | ||
<file alias="spinner-033">res/movies/spinner-033.png</file> | ||
<file alias="spinner-034">res/movies/spinner-034.png</file> | ||
<file alias="spinner-035">res/movies/spinner-035.png</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2015-2018 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
"""Test transaction signing using the signrawtransaction* RPCs.""" | ||
|
||
from test_framework.test_framework import BitcoinTestFramework | ||
import decimal | ||
|
||
class RpcCreateRawTxOutputsTest(BitcoinTestFramework): | ||
def set_test_params(self): | ||
self.setup_clean_chain = True | ||
self.num_nodes = 3 | ||
|
||
def skip_test_if_missing_module(self): | ||
self.skip_if_no_wallet() | ||
|
||
def run_test(self): | ||
node0,node1,node2 = self.nodes | ||
|
||
# 50 BTC each, rest will be 25 BTC each | ||
node0.generate(149) | ||
self.sync_all() | ||
|
||
self.do_createraw() | ||
|
||
def do_createraw(self): | ||
node0,node1,node2 = self.nodes | ||
|
||
# test createrawtxoutputs RPC | ||
addr1 = node2.getnewaddress() | ||
addr2 = node2.getnewaddress() | ||
issue1 = node2.issueasset(10.0,0,False) | ||
issue2 = node2.issueasset(10.0,0,False) | ||
self.sync_all() | ||
node0.generate(10) | ||
self.sync_all() | ||
|
||
rawissue1 = node2.getrawtransaction(issue1["txid"],True) | ||
for vout in rawissue1["vout"]: | ||
if vout["asset"] == issue1["asset"]: vout1 = vout["n"] | ||
rawissue2 = node2.getrawtransaction(issue2["txid"],True) | ||
for vout in rawissue2["vout"]: | ||
if vout["asset"] == issue2["asset"]: vout2 = vout["n"] | ||
|
||
inputs = [] | ||
outputs = [] | ||
inputs.append({"txid":issue1["txid"],"vout":vout1}) | ||
inputs.append({"txid":issue2["txid"],"vout":vout2}) | ||
outputs.append({"address":addr1,"amount":10.0,"asset":issue1["asset"]}) | ||
outputs.append({"address":addr1,"amount":5.0,"asset":issue2["asset"]}) | ||
outputs.append({"address":addr2,"amount":4.99,"asset":issue2["asset"]}) | ||
outputs.append({"address":"fee","amount":0.01,"asset":issue2["asset"]}) | ||
outputs.append({"data":"deadbeef","amount":0.0,"asset":issue2["asset"]}) | ||
|
||
# create a transaction with same address outputs | ||
node2.createrawtxoutputs(inputs,outputs) | ||
node2.signrawtransaction(rawtx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am most likely missing something, but I don't see where |
||
node2.sendrawtransaction(signtx["hex"]) | ||
|
||
self.sync_all() | ||
node0.generate(1) | ||
self.sync_all() | ||
|
||
txdec = node2.getrawtransaction(sendtx,True) | ||
|
||
assert txdec["confirmations"] == 1 | ||
assert len(txdec["vout"]) == 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could check assets and amounts, too |
||
|
||
|
||
if __name__ == '__main__': | ||
RpcCreateRawTxOutputsTest().main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems to be not relevant to the changes in RPC