diff --git a/core/capabilities/targets/write_target.go b/core/capabilities/targets/write_target.go index afbe75093ac..9e346fdf920 100644 --- a/core/capabilities/targets/write_target.go +++ b/core/capabilities/targets/write_target.go @@ -85,7 +85,7 @@ type ReportV1Metadata struct { ReportID [2]byte } -func (rm ReportV1Metadata) Bytes() ([]byte, error) { +func (rm ReportV1Metadata) Encode() ([]byte, error) { buf := new(bytes.Buffer) err := binary.Write(buf, binary.BigEndian, rm) if err != nil { @@ -95,7 +95,7 @@ func (rm ReportV1Metadata) Bytes() ([]byte, error) { } func (rm ReportV1Metadata) Length() int { - bytes, err := rm.Bytes() + bytes, err := rm.Encode() if err != nil { return 0 } @@ -161,8 +161,6 @@ func decodeReportMetadata(reportPayload []byte) (ReportV1Metadata, error) { return metadata, nil } -// TODO: Encode - type Config struct { // Address of the contract that will get the forwarded report Address string diff --git a/core/capabilities/targets/write_target_test.go b/core/capabilities/targets/write_target_test.go index 8fe54f9dd2b..715f3345e50 100644 --- a/core/capabilities/targets/write_target_test.go +++ b/core/capabilities/targets/write_target_test.go @@ -63,7 +63,7 @@ func TestWriteTarget(t *testing.T) { ReportID: [2]byte{1, 2}, } - reportMetadataBytes, err := reportMetadata.Bytes() + reportMetadataBytes, err := reportMetadata.Encode() require.NoError(t, err) validInputs, err := values.NewMap(map[string]any{