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

allow specification of 'wallet' for ensure funds calls #129

Merged
merged 3 commits into from
Feb 28, 2020

Conversation

whyrusleeping
Copy link
Member

When trying to ensure funds for a miner, we were just adding funds to the worker key, which doesnt really help much (its not associated with the miner on chain in that way). Switching that over, things then tried to send money from the miner actor, which obviously doesnt work, so now we pass the address you want to ensure has funds on the market, and the address to send funds from.

Copy link
Collaborator

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

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

LGTM

Non-blocking question on changing the client node method -- is there ever a scenario where the client ahs two addresses?

@@ -209,7 +209,7 @@ func (c *Client) Start(ctx context.Context, p ClientDealProposal) (cid.Cid, erro
ClientCollateral: big.Zero(),
}

if err := c.node.EnsureFunds(ctx, p.Client, dealProposal.ClientBalanceRequirement()); err != nil {
if err := c.node.EnsureFunds(ctx, p.Client, p.Client, dealProposal.ClientBalanceRequirement()); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious what is the value of StorageClientNode taking two parameters if it's always going to be the same (it's clear why for the provider where the values are different)

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah cause we have a common method in the integration test... I wonder if it would be better to just rewrite the test to not use fake common for that method.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cause in the implementation it's actually two different entire classes that don't share anything

Copy link
Member Author

Choose a reason for hiding this comment

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

(as mentioned in slack) lotus also uses a common thingy for implementing this. We could have them be separate interfaces, but i think the mental overhead is lower if we just have it be the same. Plus, theres no reason you couldnt fund your deal collateral with a different account

@whyrusleeping whyrusleeping merged commit ee51014 into master Feb 28, 2020
@whyrusleeping whyrusleeping deleted the feat/ensure-funds-wallet branch February 28, 2020 19:28
@dirkmc dirkmc mentioned this pull request Dec 18, 2020
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.

2 participants