-
Notifications
You must be signed in to change notification settings - Fork 293
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
multi: add amount field to TransactionInput #1297
Conversation
rpcserver.go
Outdated
prevOut := wire.NewOutPoint(txHash, input.Vout, input.Tree) | ||
txIn := wire.NewTxIn(prevOut, []byte{}) | ||
txIn := wire.NewTxIn(prevOut, int64(amt.ToUnit(dcrutil.AmountAtom)), []byte{}) |
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 should be just a type conversion from dcrutil.Amount to int64.
e1c4191
to
10e71db
Compare
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.
The JSON-RPC API docs need to be udpated as well.
d801221
to
6bce7e4
Compare
docs/json_rpc_api.md
Outdated
@@ -214,10 +214,10 @@ the method name for further details such as parameter and return information. | |||
| | | | |||
|---|---| | |||
|Method|createrawtransaction| | |||
|Parameters|1. `transaction inputs`: `(JSON array, required)` json array of json objects.<br />`hash`: `(string, required)` the hash of the input.</br> `vout`: (numeric, required) the specific output of the input transaction to redeem transaction.<br /><br />`[{"txid": "hash", "vout": n}, ...]`<br /><br />2. `addresses and amounts`: `(JSON object, required)` - json object with addresses as keys and amounts as values.</br>`address`: `(numeric, required)` the address to send to as the key and the amount in DCR as the value.<br /><br />`{"address": n.nnn, ...}`| | |||
|Parameters|1. `transaction inputs`: `(JSON array, required)` json array of json objects.</br> `amount`: `(numeric)` the previous output amount.<br />`hash`: `(string, required)` the hash of the input.</br> `vout`: (numeric, required) the specific output of the input transaction to redeem transaction.<br /><br />`[{"amount":n, "txid": "hash", "vout": n}, ...]`<br /><br />2. `addresses and amounts`: `(JSON object, required)` - json object with addresses as keys and amounts as values.</br>`address`: `(numeric, required)` the address to send to as the key and the amount in DCR as the value.<br /><br />`{"address": n.nnn, ...}`| |
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.
Missing a space before the n
in [{"amount":n, "txid": "hash", "vout": n}, ...]
.
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.
Now that there are two amounts, it should probably specifically call out that the latter amounts are outputs amounts.
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.
Finally, I noticed that the address description is inaccurate. Notice it says:
address: (numeric, required) the address to send to as the key and the amount in DCR as the value.
Which indicates it should literally be the key address
. It's not, rather it's actually the address to send the specified amount to.
This adds an amount field to TransactionInput intended for specifying the prev out amount when creating a transaction. createraw/ssrtx/sgentx/transaction rpcs are also updated accordingly as well as associated tests. A typo in assignField is also corrected.
This adds an amount field to
TransactionInput
intended for specifying the prev out amount when creating a transaction.createraw/ssrtx/sgentx/transaction
rpcs are also updated accordingly as well as associated tests.A typo in
assignField
was also corrected.Resolves #1280