From 08a556babdc8202b58bacd3db5c43ca7373cd07d Mon Sep 17 00:00:00 2001 From: bruwbird Date: Sun, 22 Sep 2024 11:08:17 +0900 Subject: [PATCH] glightning: update listpeers test https://github.com/ElementsProject/glightning/pull/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. --- glightning/lightning_test.go | 102 ++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/glightning/lightning_test.go b/glightning/lightning_test.go index 5da58c6..3c186b5 100644 --- a/glightning/lightning_test.go +++ b/glightning/lightning_test.go @@ -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, }, }, },