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

Use updated sign method #128

Merged
merged 2 commits into from
Aug 19, 2021
Merged

Use updated sign method #128

merged 2 commits into from
Aug 19, 2021

Conversation

kchulj
Copy link

@kchulj kchulj commented Aug 18, 2021

Transition from the deprecated sign to the new sign.

Also includes a commit which filters Amounts less than 5,000,000.
Smaller coin units should be filtered, so that there is enough amount in the output for the fee deduction.

Part of #26

Smaller coin units should be filtered, so that there is enough
amount in the output for the fee deduction.
@kchulj kchulj marked this pull request as draft August 18, 2021 04:30
@kchulj
Copy link
Author

kchulj commented Aug 18, 2021

This is draft until it is merged step-by-step with bosagora/agora#2370.

Copy link
Contributor

@hewison-chris hewison-chris left a comment

Choose a reason for hiding this comment

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

LGTM just some extra whitespace.

Transaction tx = txb
.sign(OutputType.Payment, 0, &this.keyUnlocker);
Transaction tx = txb.unlockSigner(&this.keyUnlocker)
.sign(OutputType.Payment, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra whitespace.

Copy link
Author

Choose a reason for hiding this comment

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

Updated.

@@ -274,7 +274,8 @@ public class Faucet : FaucetAPI
auto builder = TxBuilder(
secret_keys.byKey().drop(uniform(0, secret_keys.length, rndGen)).front());
builder.attach(utxo_rng);
return builder.sign(OutputType.Payment, 0, &this.keyUnlocker);
return builder.unlockSigner(&this.keyUnlocker)
.sign(OutputType.Payment, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra whitespace.

Copy link
Author

Choose a reason for hiding this comment

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

Where is the whitespace?

Copy link
Contributor

@hewison-chris hewison-chris Aug 19, 2021

Choose a reason for hiding this comment

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

Before the .sign. Should be like line 275.

@kchulj kchulj force-pushed the unlock branch 2 times, most recently from 8b16aac to 6052dc2 Compare August 18, 2021 04:41
Copy link
Contributor

@hewison-chris hewison-chris left a comment

Choose a reason for hiding this comment

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

LGTM but default params for sign can be used.

source/faucet/main.d Outdated Show resolved Hide resolved
source/faucet/main.d Outdated Show resolved Hide resolved
source/faucet/main.d Outdated Show resolved Hide resolved
source/faucet/main.d Outdated Show resolved Hide resolved
Transition from the deprecated sign to the new sign.
@kchulj
Copy link
Author

kchulj commented Aug 19, 2021

LGTM but default params for sign can be used.

Updated

@kchulj kchulj marked this pull request as ready for review August 19, 2021 04:50
Copy link
Contributor

@hewison-chris hewison-chris left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@hewison-chris hewison-chris left a comment

Choose a reason for hiding this comment

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

LGTM

@Geod24 Geod24 merged commit 71737f1 into bosagora:v0.x.x Aug 19, 2021
Comment on lines 244 to +247
return utxo_rng
.filter!(tup => tup.value.output.value >= Amount(count))
.filter!(tup => tup.value.output.value >= minInputValuePerOutput * count)
.map!(tup => TxBuilder(tup.value.output, tup.key))
.map!(txb => txb.split(
.map!(txb => txb.unlockSigner(&this.keyUnlocker).split(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be a bit smarter here (attaching to multiple UTXOs) but for now this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants