Skip to content

Commit

Permalink
glightning: update listpeers test
Browse files Browse the repository at this point in the history
#16 introduced
new fields to the PeerChannel struct returned
by the listpeers command,
but the corresponding test was not updated,
causing the test build to fail.
This commit fixes the test code to accommodate the changes
in the PeerChannel struct, resolving the build error.
  • Loading branch information
YusukeShimizu committed Sep 22, 2024
1 parent 5c07410 commit 08a556b
Showing 1 changed file with 53 additions and 49 deletions.
102 changes: 53 additions & 49 deletions glightning/lightning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,55 +215,59 @@ func TestListPeers(t *testing.T) {
Features: hex,
Channels: []*glightning.PeerChannel{
&glightning.PeerChannel{
State: "CHANNELD_NORMAL",
ScratchTxId: "cd13ba846709958bfd073155283c3493f08f7db1bb4ef199c014559e5505d18d",
Owner: "lightning_channeld",
ShortChannelId: "355x1x0",
ChannelDirection: 1,
ChannelId: "5415f1347cf12f30222c5968c59a4744e78ee39f0361e19b6ce2996cce4e1538",
FundingTxId: "38154ece6c99e26c9be161039fe38ee744479ac568592c22302ff17c34f11554",
Private: true,
FundingAllocations: fundingAlloc,
FundingMsat: fundingAllocMsat,
MilliSatoshiToUs: 16777215000,
ToUsMsat: glightning.AmountFromMSat(16777215000),
MilliSatoshiToUsMin: 16777215000,
MinToUsMsat: glightning.AmountFromMSat(16777215000),
MilliSatoshiToUsMax: 16777215000,
MaxToUsMsat: glightning.AmountFromMSat(16777215000),
MilliSatoshiTotal: 16777215000,
TotalMsat: glightning.AmountFromMSat(16777215000),
DustLimitSatoshi: 546,
DustLimitMsat: glightning.AmountFromMSat(546000),
MaxHtlcValueInFlightMilliSatoshi: 18446744073709551615,
MaxHtlcValueInFlightMsat: glightning.AmountFromMSat(18446744073709551615),
TheirChannelReserveSatoshi: 167773,
TheirReserveMsat: glightning.AmountFromMSat(167773000),
OurChannelReserveSatoshi: 167773,
OurReserveMsat: glightning.AmountFromMSat(167773000),
SpendableMilliSatoshi: 16609442000,
SpendableMsat: glightning.AmountFromMSat(16609442000),
HtlcMinMilliSatoshi: 10,
MinimumHtlcInMsat: glightning.AmountFromMSat(10),
TheirToSelfDelay: 6,
OurToSelfDelay: 6,
MaxAcceptedHtlcs: 483,
Status: []string{
"CHANNELD_NORMAL:Funding transaction locked. Channel announced.",
},
InPaymentsOffered: 110,
InMilliSatoshiOffered: 123,
IncomingOfferedMsat: glightning.AmountFromMSat(123),
InPaymentsFulfilled: 123,
InMilliSatoshiFulfilled: 123,
IncomingFulfilledMsat: glightning.AmountFromMSat(123),
OutPaymentsOffered: 123,
OutMilliSatoshiOffered: 123,
OutgoingOfferedMsat: glightning.AmountFromMSat(123),
OutPaymentsFulfilled: 123,
OutMilliSatoshiFulfilled: 123,
OutgoingFulfilledMsat: glightning.AmountFromMSat(123),
Htlcs: htlcs,
PeerId: "",
PeerConnected: false,
Reestablished: false,
ChannelType: glightning.ChannelType{},
IgnoreFeeLimits: false,
Updates: glightning.Updates{},
LastStableConnection: 0,
State: "CHANNELD_NORMAL",
ScratchTxId: "cd13ba846709958bfd073155283c3493f08f7db1bb4ef199c014559e5505d18d",
LastTxFeeMsat: glightning.Amount{},
LostState: false,
Feerate: glightning.Feerate{},
Owner: "lightning_channeld",
ShortChannelId: "355x1x0",
ChannelDirection: 1,
ChannelId: "5415f1347cf12f30222c5968c59a4744e78ee39f0361e19b6ce2996cce4e1538",
FundingTxId: "38154ece6c99e26c9be161039fe38ee744479ac568592c22302ff17c34f11554",
FundingOutNum: 0,
CloseToAddress: "",
CloseToScript: "",
Private: true,
Opener: "",
Alias: glightning.Alias{},
Funding: glightning.Funding{},
ToUsMsat: glightning.AmountFromMSat(16777215000),
MinToUsMsat: glightning.AmountFromMSat(16777215000),
MilliSatoshiToUsMax: 16777215000,
MaxToUsMsat: glightning.AmountFromMSat(16777215000),
TotalMsat: glightning.AmountFromMSat(16777215000),
FeeBaseMsat: 0,
FeeProportionalMillionths: 0,
DustLimitMsat: glightning.AmountFromMSat(546000),
MaxTotalHtlcInMsat: glightning.AmountFromMSat(18446744073709551615),
TheirReserveMsat: glightning.AmountFromMSat(167773000),
OurReserveMsat: glightning.AmountFromMSat(167773000),
SpendableMsat: glightning.AmountFromMSat(16609442000),
ReceivableMsat: glightning.Amount{},
MinimumHtlcInMsat: glightning.AmountFromMSat(10),
MinimumHtlcOutMsat: glightning.Amount{},
MaximumHtlcOutMsat: glightning.Amount{},
TheirToSelfDelay: 6,
OurToSelfDelay: 6,
MaxAcceptedHtlcs: 483,
Status: []string{"CHANNELD_NORMAL:Funding transaction locked. Channel announced."},
InPaymentsOffered: 110,
IncomingOfferedMsat: glightning.AmountFromMSat(123),
InPaymentsFulfilled: 123,
IncomingFulfilledMsat: glightning.AmountFromMSat(123),
OutPaymentsOffered: 123,
OutgoingOfferedMsat: glightning.AmountFromMSat(123),
OutPaymentsFulfilled: 123,
OutgoingFulfilledMsat: glightning.AmountFromMSat(123),
Htlcs: htlcs,
},
},
},
Expand Down

0 comments on commit 08a556b

Please sign in to comment.