-
Notifications
You must be signed in to change notification settings - Fork 93
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
Include verified-clients and remaining data-cap #795
Conversation
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
package module | ||
package lotuswallet |
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.
Exploring moving away from module
package names, too generic.
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.
Sounds good to me.
ffs/filcold/filcold.go
Outdated
if cfg.VerifiedDeal { | ||
vci, err := fc.wm.GetVerifiedClientInfo(ctx, cfg.Addr) | ||
if err != nil && err != wallet.ErrNoVerifiedClient { | ||
return nil, nil, 0, fmt.Errorf("get address verified client info: %s", err) | ||
} | ||
if err == wallet.ErrNoVerifiedClient { | ||
return nil, nil, 0, fmt.Errorf("wallet address isn't a verified client") | ||
} | ||
pieceSizeBig := big.NewInt(int64(pieceSize)) | ||
if pieceSizeBig.Cmp(vci.RemainingDatacapBytes) == 1 { | ||
return nil, nil, 0, fmt.Errorf("the remaining data-cap %d MiB is less than piece-size %d MiB", pieceSize/1024/1024, vci.RemainingDatacapBytes.Uint64()/1024/1024) | ||
} | ||
} |
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.
Fail-fast logic to unverified or not-enough-data-cap situations.
VerifiedClientInfo verified_client_info = 5; | ||
|
||
message VerifiedClientInfo { | ||
string remaining_datacap_bytes = 1; |
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.
This is string
since the native type is BigInt
, so in some extreme case, the user could have a lot of verified deal capacity.
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.
Nice!
package module | ||
package lotuswallet |
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.
Sounds good to me.
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This PR:
Addresses(...)
API information about verified-addresses.