diff --git a/rfqmsg/buy_accept.go b/rfqmsg/buy_accept.go index 07c961fe1..c4122676b 100644 --- a/rfqmsg/buy_accept.go +++ b/rfqmsg/buy_accept.go @@ -2,11 +2,9 @@ package rfqmsg import ( "bytes" - "crypto/sha256" "fmt" "io" - "github.com/lightninglabs/taproot-assets/asset" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/routing/route" "github.com/lightningnetwork/lnd/tlv" @@ -20,7 +18,6 @@ const ( TypeBuyAcceptAskPrice tlv.Type = 4 TypeBuyAcceptExpiry tlv.Type = 6 TypeBuyAcceptSignature tlv.Type = 8 - TypeBuyAcceptAssetID tlv.Type = 10 ) func TypeRecordBuyAcceptVersion(version *WireMsgDataVersion) tlv.Record { @@ -81,15 +78,6 @@ func TypeRecordBuyAcceptSig(sig *[64]byte) tlv.Record { return tlv.MakePrimitiveRecord(TypeBuyAcceptSignature, sig) } -func TypeRecordBuyAcceptAssetID(assetID **asset.ID) tlv.Record { - const recordSize = sha256.Size - - return tlv.MakeStaticRecord( - TypeBuyAcceptAssetID, assetID, recordSize, - AssetIdEncoder, AssetIdDecoder, - ) -} - const ( // latestBuyAcceptVersion is the latest supported buy accept wire // message data field version. @@ -115,28 +103,17 @@ type buyAcceptMsgData struct { // sig is a signature over the serialized contents of the message. sig [64]byte - - // AssetID is the asset ID of the asset that the accept message is for. - AssetID *asset.ID } // encodeRecords provides all TLV records for encoding. func (q *buyAcceptMsgData) encodeRecords() []tlv.Record { - records := []tlv.Record{ + return []tlv.Record{ TypeRecordBuyAcceptVersion(&q.Version), TypeRecordBuyAcceptID(&q.ID), TypeRecordBuyAcceptAskPrice(&q.AskPrice), TypeRecordBuyAcceptExpiry(&q.Expiry), TypeRecordBuyAcceptSig(&q.sig), } - - if q.AssetID != nil { - records = append( - records, TypeRecordBuyAcceptAssetID(&q.AssetID), - ) - } - - return records } // decodeRecords provides all TLV records for decoding. @@ -147,7 +124,6 @@ func (q *buyAcceptMsgData) decodeRecords() []tlv.Record { TypeRecordBuyAcceptAskPrice(&q.AskPrice), TypeRecordBuyAcceptExpiry(&q.Expiry), TypeRecordBuyAcceptSig(&q.sig), - TypeRecordBuyAcceptAssetID(&q.AssetID), } } @@ -211,7 +187,6 @@ func NewBuyAcceptFromRequest(request BuyRequest, askPrice lnwire.MilliSatoshi, ID: request.ID, AskPrice: askPrice, Expiry: expiry, - AssetID: request.AssetID, }, } } diff --git a/rfqmsg/sell_accept.go b/rfqmsg/sell_accept.go index dc96dc313..b1d1d382f 100644 --- a/rfqmsg/sell_accept.go +++ b/rfqmsg/sell_accept.go @@ -2,12 +2,10 @@ package rfqmsg import ( "bytes" - "crypto/sha256" "encoding/binary" "fmt" "io" - "github.com/lightninglabs/taproot-assets/asset" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/routing/route" "github.com/lightningnetwork/lnd/tlv" @@ -21,7 +19,6 @@ const ( TypeSellAcceptBidPrice tlv.Type = 4 TypeSellAcceptExpiry tlv.Type = 6 TypeSellAcceptSignature tlv.Type = 8 - TypeSellAcceptAssetID tlv.Type = 10 ) func TypeRecordSellAcceptVersion(version *WireMsgDataVersion) tlv.Record { @@ -56,15 +53,6 @@ func TypeRecordSellAcceptSig(sig *[64]byte) tlv.Record { return tlv.MakePrimitiveRecord(TypeSellAcceptSignature, sig) } -func TypeRecordSellAcceptAssetID(assetID **asset.ID) tlv.Record { - const recordSize = sha256.Size - - return tlv.MakeStaticRecord( - TypeSellAcceptAssetID, assetID, recordSize, - AssetIdEncoder, AssetIdDecoder, - ) -} - const ( // latestSellAcceptVersion is the latest supported sell accept wire // message data field version. @@ -90,28 +78,17 @@ type sellAcceptMsgData struct { // sig is a signature over the serialized contents of the message. sig [64]byte - - // AssetID is the asset ID of the asset that the accept message is for. - AssetID *asset.ID } // encodeRecords provides all TLV records for encoding. func (q *sellAcceptMsgData) encodeRecords() []tlv.Record { - records := []tlv.Record{ + return []tlv.Record{ TypeRecordSellAcceptVersion(&q.Version), TypeRecordSellAcceptID(&q.ID), TypeRecordSellAcceptBidPrice(&q.BidPrice), TypeRecordSellAcceptExpiry(&q.Expiry), TypeRecordSellAcceptSig(&q.sig), } - - if q.AssetID != nil { - records = append( - records, TypeRecordSellAcceptAssetID(&q.AssetID), - ) - } - - return records } // decodeRecords provides all TLV records for decoding. @@ -122,7 +99,6 @@ func (q *sellAcceptMsgData) decodeRecords() []tlv.Record { TypeRecordSellAcceptBidPrice(&q.BidPrice), TypeRecordSellAcceptExpiry(&q.Expiry), TypeRecordSellAcceptSig(&q.sig), - TypeRecordSellAcceptAssetID(&q.AssetID), } } @@ -186,7 +162,6 @@ func NewSellAcceptFromRequest(request SellRequest, bidPrice lnwire.MilliSatoshi, ID: request.ID, BidPrice: bidPrice, Expiry: expiry, - AssetID: request.AssetID, }, } }