-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix spend logic for unlock deposit amount #86
base: dev
Are you sure you want to change the base?
Conversation
|
@@ -1443,7 +1445,7 @@ export class Builder { | |||
changeThreshold | |||
) | |||
|
|||
aad.addAssetAmount(feeAssetID, zero, fee) | |||
aad.addAssetAmount(feeAssetID, amountToUnlock, fee) | |||
|
|||
const minSpendableErr: Error = await this.spender.getMinimumSpendable( |
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.
- call spend for burning the already unlocked UTXOs
- call a call to a different function (undeposit ) to unlock the locked UTXOs
* @param changeThreshold Optional. The number of signatures required to spend the funds in the resultant change UTXO | ||
* | ||
* @returns An unsigned transaction created from the passed in parameters. | ||
*/ | ||
buildUnlockDepositTx = async ( | ||
utxoset: UTXOSet, | ||
fromAddresses: string[], | ||
fromAddresses: FromType, |
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.
Instead of fromAdresses we need depositTxIDs (better than depositOfferId)
We skip the amount for now
|
This PR changes the signature of api buildUnlockDepositTx by converting fromAddresses to commonly used
FromType
and adds the argumentamountToUnlock
in the builder function to consider it when constructing in/output utxos by calling the node spend logic.