-
Notifications
You must be signed in to change notification settings - Fork 386
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
rawissueasset RPC call #474
rawissueasset RPC call #474
Conversation
26748c4
to
72683ff
Compare
63714d0
to
b9f7ce8
Compare
I should add light tests for |
b9f7ce8
to
b989fd9
Compare
Added contract/sequential tests, fixed unexpected behavior of the contract argument expecting hex string. |
b989fd9
to
7515536
Compare
Changed return value for RPC call to be a list of objects with issuance details, added basic tests. |
Realized the wallet is possible appending tokens to vector beyond the fee output, which is always the last output by wallet default. Will fix. |
7515536
to
87fb1e2
Compare
fixed the output pushing fee output issue |
src/rpc/rawtransaction.cpp
Outdated
{ | ||
if (request.fHelp || request.params.size() != 2) | ||
throw runtime_error( | ||
"rawissueasset transaction [{\"asset_amount\":x.xxx, \"asset_address\":\"address\", \"token_amount\":x.xxx, \"token_address\":\"address\", \"blind\":bool}, ...]\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.
add contract
src/rpc/rawtransaction.cpp
Outdated
} | ||
|
||
CAmount token_amount = 0; | ||
const UniValue& token_amount_uni = find_value(issuance_o, "token_amount"); |
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.
switch from find_value to direct access for style
I'm going to switch the contract argument to a contract hash, passed in as hex string. This will streamline the reissuance call. |
87fb1e2
to
ca383ac
Compare
Pushed update addressing some of @stevenroose comments as well as converting the contract argument to a hash. |
tACK ca383ac |
ca383ac add functional testing for raw issuance call (Gregory Sanders) a5e1af5 rawissueasset RPC call (Gregory Sanders) f9f91ba Fixup issueasset help results information (Gregory Sanders) 69d8d15 Break out issuance-specific testing to its own functional test (Gregory Sanders) 2b22b6d Fixup (raw)blindrawtransaction (Gregory Sanders) a5e9e0e Fix blinding logic for issuances on input 1 or higher (Gregory Sanders) 83df289 fixup BlindTransaction issuance counting assertion (Gregory Sanders) Pull request description: Resolves the initial issuance portion of: #471 The user follows this flow: `createrawtransaction->fundrawtransaction->rawissueasset->blindrawtransaction->signrawtransaction` `rawissueasset` is a new RPC call that allows the user to append N-many issuances, up to the amount of inputs the transaction has, at once. It allows the issuances to be "marked" for blinding later(only effects reissance token asset id), and for the destination outputs to be arbitrary addresses, blinded or otherwise. Previously `fundrawtransaction` would not blind issuances(pretty much on accident), so I have added an argument, default `true`, on whether to blind issuances, since there is no field in the transaction itself to mark as whether we want to blind it or not. Note: This will cause your transactions' fee-rate to go down, so the caller may want to over-shoot fees during the `fundrawtransaction` call as cushion. I also fixed a couple bugs on the way as I uncovered them. Tree-SHA512: fa77158c390743f579797d426b9d9cb000a5d686a8b10aa818b1e9ad65fdc42ac139a36ad226e31676b3bd9c6643bc69074869d6a927309a7ec328c91e853bec
Resolves the initial issuance portion of: #471
The user follows this flow:
createrawtransaction->fundrawtransaction->rawissueasset->blindrawtransaction->signrawtransaction
rawissueasset
is a new RPC call that allows the user to append N-many issuances, up to the amount of inputs the transaction has, at once. It allows the issuances to be "marked" for blinding later(only effects reissance token asset id), and for the destination outputs to be arbitrary addresses, blinded or otherwise.Previously
fundrawtransaction
would not blind issuances(pretty much on accident), so I have added an argument, defaulttrue
, on whether to blind issuances, since there is no field in the transaction itself to mark as whether we want to blind it or not.Note: This will cause your transactions' fee-rate to go down, so the caller may want to over-shoot fees during the
fundrawtransaction
call as cushion.I also fixed a couple bugs on the way as I uncovered them.