File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -723,6 +723,10 @@ var allTestCases = []*lntest.TestCase{
723723 Name : "grpc not found" ,
724724 TestFunc : testGRPCNotFound ,
725725 },
726+ {
727+ Name : "estimate fee" ,
728+ TestFunc : testEstimateFee ,
729+ },
726730}
727731
728732// appendPrefixed is used to add a prefix to each test name in the subtests
Original file line number Diff line number Diff line change 11package itest
22
33import (
4+ "context"
45 "encoding/hex"
56 "fmt"
67 "os"
@@ -1391,3 +1392,25 @@ func testGRPCNotFound(ht *lntest.HarnessTest) {
13911392 RHash : rHash ,
13921393 }, notFoundErr )
13931394}
1395+
1396+ // testEstimateFee tests walletrpc.EstimateFee API.
1397+ func testEstimateFee (ht * lntest.HarnessTest ) {
1398+ alice := ht .NewNode ("Alice" , nil )
1399+
1400+ ctx := context .Background ()
1401+
1402+ // Make sure it passes with conf_target=1.
1403+ req := & walletrpc.EstimateFeeRequest {
1404+ ConfTarget : 1 ,
1405+ }
1406+ resp , err := alice .RPC .WalletKit .EstimateFee (ctx , req )
1407+ require .NoError (ht , err )
1408+ require .NotZero (ht , resp .SatPerKw )
1409+ require .NotZero (ht , resp .MinRelayFeeSatPerKw )
1410+
1411+ // Make sure it fails with conf_target=0.
1412+ req .ConfTarget = 0
1413+ _ , err = alice .RPC .WalletKit .EstimateFee (ctx , req )
1414+ require .ErrorContains (ht , err , "confirmation target must be greater " +
1415+ "than 0" )
1416+ }
You can’t perform that action at this time.
0 commit comments