-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
paych: get available funds by address or by from/to #3547
Conversation
@@ -207,22 +207,23 @@ type FullNodeStruct struct { | |||
|
|||
MarketEnsureAvailable func(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` | |||
|
|||
PaychGet func(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) `perm:"sign"` |
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.
Just an indentation change
if err != nil { | ||
return err | ||
} | ||
|
||
if avail.Channel == nil { |
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.
The logic of formatting the channel status output is the same, it's just been extracted into a method that's called by both paych status
and paych status-by-from-to
} | ||
} | ||
|
||
func (ca *channelAccessor) currentAvailableFunds(queuedAmt types.BigInt) (*api.ChannelAvailableFunds, error) { |
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.
Moved the logic for what to do if the channel is not found into the manager layer
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.
LGTM
Previously we had a method to get available funds for a channel by from/to, which makes sense from CLI. However for markets non-blocking retrieval it makes more sense to get funds by channel address.
This PR adds a new API method to get available funds by channel address. So now there are two API methods to get available funds for a channel: