diff --git a/rfqmsg/records.go b/rfqmsg/records.go index 96aaa5f42..9f5cb6945 100644 --- a/rfqmsg/records.go +++ b/rfqmsg/records.go @@ -2,7 +2,6 @@ package rfqmsg import ( "bytes" - "crypto/sha256" "errors" "fmt" "io" @@ -391,33 +390,3 @@ func IdDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error { return tlv.NewTypeForDecodingErr(val, "MessageID", l, idBytesLen) } - -func AssetIdEncoder(w io.Writer, val any, buf *[8]byte) error { - if t, ok := val.(**asset.ID); ok { - id := [sha256.Size]byte(**t) - return tlv.EBytes32(w, &id, buf) - } - - return tlv.NewTypeForEncodingErr(val, "assetId") -} - -func AssetIdDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error { - const assetIDBytesLen = sha256.Size - - if typ, ok := val.(**asset.ID); ok { - var idBytes [assetIDBytesLen]byte - - err := tlv.DBytes32(r, &idBytes, buf, assetIDBytesLen) - if err != nil { - return err - } - - id := asset.ID(idBytes) - assetId := &id - - *typ = assetId - return nil - } - - return tlv.NewTypeForDecodingErr(val, "assetId", l, sha256.Size) -}