-
Notifications
You must be signed in to change notification settings - Fork 41
Send all test #126
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
base: master
Are you sure you want to change the base?
Send all test #126
Conversation
| let env = TestEnvBuilder::from_env().with_electrum().build(); | ||
| let signer = generate_signer(); | ||
| let view_key = generate_view_key(); | ||
| let desc = format!("ct({},elwpkh({}/*))", view_key, signer.xpub()); |
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.
nit:
| let desc = format!("ct({},elwpkh({}/*))", view_key, signer.xpub()); | |
| let desc = format!("ct({},elwpkh({}/<0;1>/*))", view_key, signer.xpub()); |
since this PR is affecting the change we have the test generating change addresses
(although for the sake of this PR it should not matter)
| let mut pset = wallet | ||
| .tx_builder() | ||
| .drain_lbtc_wallet() | ||
| .add_lbtc_recipient(&node_address, 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.
Do we have a test where we do the same thing, but sending to an explicit address?
| } else { | ||
| wollet.addressee_change( | ||
| // Track whether we add a change/drain output (needed later for fee adjustment). | ||
| // Skip change only when: drain_lbtc is set AND there are explicit recipients AND no drain_to. |
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.
where are we checking checking that there are explicit recipients ?
| // Track whether we add a change/drain output (needed later for fee adjustment). | ||
| // Skip change only when: drain_lbtc is set AND there are explicit recipients AND no drain_to. | ||
| // If there are no recipients (satoshi_out == 0), we always need a change/drain output. | ||
| let has_change_output = self.drain_to.is_some() || !self.drain_lbtc || satoshi_out == 0; |
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.
since has_change_output is only used once below, it makes sense to compute it below, and move all of the comments there
current situationour flow for sending LBTC (ignoring issuance, reissuance, assets) is
Drain/"send all" methods:
Note: at the moment, for the sake of simplicity, we always add all LBTC utxos, thus requestThe request is to have these 2 PSETs equivalent (equal modulo blinding randomness): In other words, we should not add a change if it's "too low". Ideally we don't do the blinding twice, and instead we estimate how many bytes each blinded output adds, use the amount computed to find the fee to match the fee rate, and decide whether or not we should add the change (as it's done by bitcoin wallets incl. GDK). So we can't use |
No description provided.