multi: refactor testUpdateChannelPolicy

This commit is contained in:
yyforyongyu committed 2022-11-17 20:58:05 +08:00
1 parent 1d7c568fcf
commit 22f8f83412
8 files changed
+290 -214

No files matched your search

+3 -3
View File
@@ -559,7 +559,7 @@ func (nw *nodeWatcher) handlePolicyUpdateWatchRequest(req *chanWatchRequest) {
// Check if the latest policy is matched.
policy := policies[len(policies)-1]
if checkChannelPolicy(policy.RoutingPolicy, req.policy) == nil {
if CheckChannelPolicy(policy.RoutingPolicy, req.policy) == nil {
close(req.eventChan)
return
}
@@ -653,8 +653,8 @@ func (nw *nodeWatcher) getChannelPolicies(include bool) policyUpdateMap {
return policyUpdates
}
// checkChannelPolicy checks that the policy matches the expected one.
func checkChannelPolicy(policy, expectedPolicy *lnrpc.RoutingPolicy) error {
// CheckChannelPolicy checks that the policy matches the expected one.
func CheckChannelPolicy(policy, expectedPolicy *lnrpc.RoutingPolicy) error {
if policy.FeeBaseMsat != expectedPolicy.FeeBaseMsat {
return fmt.Errorf("expected base fee %v, got %v",
expectedPolicy.FeeBaseMsat, policy.FeeBaseMsat)