Skip to content
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

Send custom inputs #165

Merged
merged 16 commits into from
Nov 13, 2020
Merged

Conversation

song50119
Copy link
Contributor

@song50119 song50119 commented Oct 23, 2020

PR is continues process on this branch for UTXO

  • Do refactor old code
  • Adds utxo.go and move on methods related with UTXO to
  • Remove txhelper/internal/txsizes/size.go txhelper/unsignedtx.go txhelper/types.go files since it isn't necessary
  • Use TransactionDestination type from types.go
  • Refactor (*TxAuthor).ParseOutputsAndChangeDestination
  • Refactor (*Wallet).UnspentOutputs
  • Refactor (*TxAuthor).constructCustomTransaction
  • Refactor calculateChangeScriptSize, calculateMultipleChangeScriptSize

accounts.go Outdated Show resolved Hide resolved
types.go Outdated Show resolved Hide resolved
accounts.go Outdated Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
txauthor.go Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
types.go Outdated Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
utxo.go Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
* Refactor (*TxAuthor).UseInputs find utxo by txn outpoint
* Adds (*TxAuthor).newUnsignedTxUTXO
* Change UnspentOutput.Address to UnspentOutput.Addresses
txauthor.go Outdated Show resolved Hide resolved
txauthor.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
utxo.go Outdated

for _, destination := range txDestinations {
// validate the amount to send to this destination address
if !destination.SendMax && (destination.AtomAmount <= 0 || destination.AtomAmount > dcrutil.MaxAmount) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do amount validation here, do it when adding the send destination here and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the mobile or wallet if developer is forget to check errors at AddSendDestination or UpdateSendDestination, we should validate again here, right?

utxo.go Outdated Show resolved Hide resolved
utxo.go Outdated Show resolved Hide resolved
@beansgum beansgum added this to In Progress in dcrlibwallet board Nov 6, 2020
* Change (*TxAuthor).changeDestinations slice to single changeDestination
* Adds (*TxAuthor).validateAmount && git push origin send-custom-inputs
dcrlibwallet board automation moved this from In Progress to Approved Nov 13, 2020
@beansgum beansgum merged commit 7786819 into planetdecred:master Nov 13, 2020
dcrlibwallet board automation moved this from Approved to Done Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants