mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
itest: preparatory fee estimation changes
This commit is contained in:
@@ -1614,8 +1614,8 @@ func (h *HarnessTest) mineTillForceCloseResolved(hn *node.HarnessNode) {
|
||||
// CreatePayReqs is a helper method that will create a slice of payment
|
||||
// requests for the given node.
|
||||
func (h *HarnessTest) CreatePayReqs(hn *node.HarnessNode,
|
||||
paymentAmt btcutil.Amount, numInvoices int) ([]string,
|
||||
[][]byte, []*lnrpc.Invoice) {
|
||||
paymentAmt btcutil.Amount, numInvoices int,
|
||||
routeHints ...*lnrpc.RouteHint) ([]string, [][]byte, []*lnrpc.Invoice) {
|
||||
|
||||
payReqs := make([]string, numInvoices)
|
||||
rHashes := make([][]byte, numInvoices)
|
||||
@@ -1624,9 +1624,10 @@ func (h *HarnessTest) CreatePayReqs(hn *node.HarnessNode,
|
||||
preimage := h.Random32Bytes()
|
||||
|
||||
invoice := &lnrpc.Invoice{
|
||||
Memo: "testing",
|
||||
RPreimage: preimage,
|
||||
Value: int64(paymentAmt),
|
||||
Memo: "testing",
|
||||
RPreimage: preimage,
|
||||
Value: int64(paymentAmt),
|
||||
RouteHints: routeHints,
|
||||
}
|
||||
resp := hn.RPC.AddInvoice(invoice)
|
||||
|
||||
|
||||
@@ -876,6 +876,19 @@ func (hn *HarnessNode) RestoreDB() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateGlobalPolicy updates a node's global channel policy.
|
||||
func (hn *HarnessNode) UpdateGlobalPolicy(policy *lnrpc.RoutingPolicy) {
|
||||
updateFeeReq := &lnrpc.PolicyUpdateRequest{
|
||||
BaseFeeMsat: policy.FeeBaseMsat,
|
||||
FeeRate: float64(policy.FeeRateMilliMsat) /
|
||||
float64(1_000_000),
|
||||
TimeLockDelta: policy.TimeLockDelta,
|
||||
Scope: &lnrpc.PolicyUpdateRequest_Global{Global: true},
|
||||
MaxHtlcMsat: policy.MaxHtlcMsat,
|
||||
}
|
||||
hn.RPC.UpdateChannelPolicy(updateFeeReq)
|
||||
}
|
||||
|
||||
func postgresDatabaseDsn(dbName string) string {
|
||||
return fmt.Sprintf(postgresDsn, dbName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user