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

inject publickeyring #3086

Merged
merged 7 commits into from
Aug 16, 2019
Merged

inject publickeyring #3086

merged 7 commits into from
Aug 16, 2019

Conversation

christophsturm
Copy link
Contributor

based on #3081

Copy link
Contributor

@mrosseel mrosseel left a comment

Choose a reason for hiding this comment

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

utACK

Don't know how the 'mergers' think about this but wouldn't it be cleaner if you rebase this on your previous PR (this PR doesn't only contain the inject publickeyring changes) ? You could add a 'blocked by #123' comment so it doesn't get merged before the parent. Would make for cleaner diffs

public void canInstantiate() {
P2PService p2PService = mock(P2PService.class);
when(p2PService.getNumConnectedPeers()).thenReturn(new SimpleIntegerProperty(0));
Storage storage = mock(Storage.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

why is storage mocked separately? It's just passed as an argument like the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that test is just a stub that got me thinking about the pubkey.


import org.bitcoinj.core.Coin;

public class MakerFeeMaker {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about the name, too many makers making things :)
Don't have any good alternatives though... MakerFeeFactory, MakerFeeCalculation, MakerFeeCreator, ... (if you don't find anything better don't worry)

This is just a wrapper for one of the util classes, so will you need to do this for every method in every Util class? Are you trying to avoid calls to static methods for unit testing purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm trying to get rid of the static util classes, for testing purpose but also for architectural purposes. this is part of the parent pr, see the description of this pr

@christophsturm
Copy link
Contributor Author

utACK

Don't know how the 'mergers' think about this but wouldn't it be cleaner if you rebase this on your previous PR (this PR doesn't only contain the inject publickeyring changes) ? You could add a 'blocked by #123' comment so it doesn't get merged before the parent. Would make for cleaner diffs

i can only rebase this pr once the other one is in master. and then i will rebase it and it will be much smaller.

Copy link
Contributor

@mrosseel mrosseel left a comment

Choose a reason for hiding this comment

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

Is this not confusing, there are already the guice providers?

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

NACK

See comment for missing final.

I will review again after rebase with other PR is done.

@@ -96,6 +98,7 @@ protected void configure() {
install(alertModule());
install(filterModule());
install(corePresentationModule());
bind(PubKeyRing.class).toProvider(PubKeyRingProvider.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to be in singleton context?
Can you move it to the other bindings above, so th einstall calls are not mixed with bind calls?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah from the test below its seems its singleton.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i made sure that it is.

@@ -42,7 +42,7 @@
@Slf4j
@EqualsAndHashCode
@Getter
public final class PubKeyRing implements NetworkPayload, UsedForTradeContractJson {
public class PubKeyRing implements NetworkPayload, UsedForTradeContractJson {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be used in p2p messages so must be final. I know its prob. not used now but further refactoring might use it... all NetworkPayload classes should be final.

@ManfredKarrer
Copy link
Contributor

Is this not confusing, there are already the guice providers?

We use the term provider in a wider range. IMO its not bad, better then factory IMO as thats more overloaded.

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

ACK

@@ -106,7 +106,7 @@
private final TxFeeEstimationService txFeeEstimationService;
private final ReferralIdService referralIdService;
private final BSFormatter btcFormatter;
private MakerFeeMaker makerFeeMaker;
private MakerFeeProvider makerFeeProvider;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be final

@sqrrm sqrrm merged commit 4381eea into bisq-network:master Aug 16, 2019
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.

4 participants