Skip to content

Commit

Permalink
rfqmsg: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero authored and ffranr committed Sep 16, 2024
1 parent a492f25 commit ad1b5d5
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions rfqmsg/records.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package rfqmsg

import (
"bytes"
"crypto/sha256"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -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)
}

0 comments on commit ad1b5d5

Please sign in to comment.