diff --git a/pkg/mercury/config_poller.go b/pkg/mercury/config_poller.go index 495a61cadc..405707544b 100644 --- a/pkg/mercury/config_poller.go +++ b/pkg/mercury/config_poller.go @@ -14,7 +14,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-evm/gethwrappers/llo-feeds/generated/verifier" "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" ) // FeedScopedConfigSet ConfigSet with FeedID for use with mercury (and multi-config DON) @@ -39,7 +38,7 @@ func init() { // FullConfigFromLog defines the contract config with the feedID type FullConfigFromLog struct { ocrtypes.ContractConfig - feedID utils.FeedID + feedID common.Hash } func unpackLogData(d []byte) (*verifier.VerifierConfigSet, error) { diff --git a/pkg/mercury/helpers_test.go b/pkg/mercury/helpers_test.go index 2b9f80ae7f..a7e844cdc8 100644 --- a/pkg/mercury/helpers_test.go +++ b/pkg/mercury/helpers_test.go @@ -1,7 +1,6 @@ package mercury import ( - "encoding/base64" "math/big" "testing" "time" @@ -15,9 +14,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-evm/gethwrappers/llo-feeds/generated/verifier" @@ -25,95 +21,9 @@ import ( evmclient "github.com/smartcontractkit/chainlink-evm/pkg/client" "github.com/smartcontractkit/chainlink-evm/pkg/heads/headstest" "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" - reportcodecv2 "github.com/smartcontractkit/chainlink-evm/pkg/mercury/v2/reportcodec" - reportcodecv3 "github.com/smartcontractkit/chainlink-evm/pkg/mercury/v3/reportcodec" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" ) -const sampleClientPubKey = "0x724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" - -var sampleFeedID = [32]uint8{28, 145, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} - -var sampleReports [][]byte - -var ( - sampleV2Report = buildSampleV2Report(242) - sampleV3Report = buildSampleV3Report(242) - sig2 = ocrtypes.AttributedOnchainSignature{Signature: mustDecodeBase64("kbeuRczizOJCxBzj7MUAFpz3yl2WRM6K/f0ieEBvA+oTFUaKslbQey10krumVjzAvlvKxMfyZo0WkOgNyfF6xwE="), Signer: 2} - sig3 = ocrtypes.AttributedOnchainSignature{Signature: mustDecodeBase64("9jz4b6Dh2WhXxQ97a6/S9UNjSfrEi9016XKTrfN0mLQFDiNuws23x7Z4n+6g0sqKH/hnxx1VukWUH/ohtw83/wE="), Signer: 3} - sampleSigs = []ocrtypes.AttributedOnchainSignature{sig2, sig3} - sampleReportContext = ocrtypes.ReportContext{ - ReportTimestamp: ocrtypes.ReportTimestamp{ - ConfigDigest: MustHexToConfigDigest("0x0006fc30092226b37f6924b464e16a54a7978a9a524519a73403af64d487dc45"), - Epoch: 6, - Round: 28, - }, - ExtraHash: [32]uint8{27, 144, 106, 73, 166, 228, 123, 166, 179, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}, - } -) - -func init() { - sampleReports = make([][]byte, 4) - for i := 0; i < len(sampleReports); i++ { - sampleReports[i] = buildSampleV2Report(int64(i)) - } -} - -func buildSampleV2Report(ts int64) []byte { - feedID := sampleFeedID - timestamp := uint32(ts) - bp := big.NewInt(242) - validFromTimestamp := uint32(123) - expiresAt := uint32(456) - linkFee := big.NewInt(3334455) - nativeFee := big.NewInt(556677) - - b, err := reportcodecv2.ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp) - if err != nil { - panic(err) - } - return b -} - -func buildSampleV3Report(ts int64) []byte { - feedID := sampleFeedID - timestamp := uint32(ts) - bp := big.NewInt(242) - bid := big.NewInt(243) - ask := big.NewInt(244) - validFromTimestamp := uint32(123) - expiresAt := uint32(456) - linkFee := big.NewInt(3334455) - nativeFee := big.NewInt(556677) - - b, err := reportcodecv3.ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp, bid, ask) - if err != nil { - panic(err) - } - return b -} - -func buildSamplePayload(report []byte) []byte { - var rs [][32]byte - var ss [][32]byte - var vs [32]byte - for i, as := range sampleSigs { - r, s, v, err := evmutil.SplitSignature(as.Signature) - if err != nil { - panic("eventTransmit(ev): error in SplitSignature") - } - rs = append(rs, r) - ss = append(ss, s) - vs[i] = v - } - rawReportCtx := evmutil.RawReportContext(sampleReportContext) - payload, err := PayloadTypes.Pack(rawReportCtx, report, rs, ss, vs) - if err != nil { - panic(err) - } - return payload -} - type TestHarness struct { configPoller *ConfigPoller user *bind.TransactOpts @@ -175,12 +85,3 @@ func SetupTH(t *testing.T, feedID common.Hash) TestHarness { logPoller: lp, } } - -func mustDecodeBase64(s string) (b []byte) { - var err error - b, err = base64.StdEncoding.DecodeString(s) - if err != nil { - panic(err) - } - return -} diff --git a/pkg/mercury/moved/helpers_test.go b/pkg/mercury/moved/helpers_test.go new file mode 100644 index 0000000000..baae7c827c --- /dev/null +++ b/pkg/mercury/moved/helpers_test.go @@ -0,0 +1,117 @@ +package moved + +import ( + "encoding/base64" + "math/big" + + "github.com/ethereum/go-ethereum/common/hexutil" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2/types" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/v2/reportcodec" + reportcodec2 "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/v3/reportcodec" +) + +const sampleClientPubKey = "0x724ff6eae9e900270edfff233e16322a70ec06e1a6e62a81ef13921f398f6c93" + +var sampleFeedID = [32]uint8{28, 145, 107, 74, 167, 229, 124, 167, 182, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114} + +var sampleReports [][]byte + +var ( + sampleV2Report = buildSampleV2Report(242) + sampleV3Report = buildSampleV3Report(242) + sig2 = types.AttributedOnchainSignature{Signature: mustDecodeBase64("kbeuRczizOJCxBzj7MUAFpz3yl2WRM6K/f0ieEBvA+oTFUaKslbQey10krumVjzAvlvKxMfyZo0WkOgNyfF6xwE="), Signer: 2} + sig3 = types.AttributedOnchainSignature{Signature: mustDecodeBase64("9jz4b6Dh2WhXxQ97a6/S9UNjSfrEi9016XKTrfN0mLQFDiNuws23x7Z4n+6g0sqKH/hnxx1VukWUH/ohtw83/wE="), Signer: 3} + sampleSigs = []types.AttributedOnchainSignature{sig2, sig3} + sampleReportContext = types.ReportContext{ + ReportTimestamp: types.ReportTimestamp{ + ConfigDigest: mustHexToConfigDigest("0x0006fc30092226b37f6924b464e16a54a7978a9a524519a73403af64d487dc45"), + Epoch: 6, + Round: 28, + }, + ExtraHash: [32]uint8{27, 144, 106, 73, 166, 228, 123, 166, 179, 138, 225, 191, 69, 101, 63, 86, 182, 86, 253, 58, 163, 53, 239, 127, 174, 105, 107, 102, 63, 27, 132, 114}, + } +) + +func init() { + sampleReports = make([][]byte, 4) + for i := 0; i < len(sampleReports); i++ { + sampleReports[i] = buildSampleV2Report(int64(i)) + } +} + +func buildSampleV2Report(ts int64) []byte { + feedID := sampleFeedID + timestamp := uint32(ts) + bp := big.NewInt(242) + validFromTimestamp := uint32(123) + expiresAt := uint32(456) + linkFee := big.NewInt(3334455) + nativeFee := big.NewInt(556677) + + b, err := reportcodec.ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp) + if err != nil { + panic(err) + } + return b +} + +func buildSampleV3Report(ts int64) []byte { + feedID := sampleFeedID + timestamp := uint32(ts) + bp := big.NewInt(242) + bid := big.NewInt(243) + ask := big.NewInt(244) + validFromTimestamp := uint32(123) + expiresAt := uint32(456) + linkFee := big.NewInt(3334455) + nativeFee := big.NewInt(556677) + + b, err := reportcodec2.ReportTypes.Pack(feedID, validFromTimestamp, timestamp, nativeFee, linkFee, expiresAt, bp, bid, ask) + if err != nil { + panic(err) + } + return b +} + +func buildSamplePayload(report []byte) []byte { + var rs [][32]byte + var ss [][32]byte + var vs [32]byte + for i, as := range sampleSigs { + r, s, v, err := evmutil.SplitSignature(as.Signature) + if err != nil { + panic("eventTransmit(ev): error in SplitSignature") + } + rs = append(rs, r) + ss = append(ss, s) + vs[i] = v + } + rawReportCtx := evmutil.RawReportContext(sampleReportContext) + payload, err := PayloadTypes.Pack(rawReportCtx, report, rs, ss, vs) + if err != nil { + panic(err) + } + return payload +} + +func mustDecodeBase64(s string) (b []byte) { + var err error + b, err = base64.StdEncoding.DecodeString(s) + if err != nil { + panic(err) + } + return +} + +func mustHexToConfigDigest(s string) (cd ocrtypes.ConfigDigest) { + b := hexutil.MustDecode(s) + var err error + cd, err = ocrtypes.BytesToConfigDigest(b) + if err != nil { + panic(err) + } + return +} diff --git a/pkg/mercury/mocks/async_deleter.go b/pkg/mercury/moved/mocks/async_deleter.go similarity index 94% rename from pkg/mercury/mocks/async_deleter.go rename to pkg/mercury/moved/mocks/async_deleter.go index 9fd8ba09ef..7b5a1b69e3 100644 --- a/pkg/mercury/mocks/async_deleter.go +++ b/pkg/mercury/moved/mocks/async_deleter.go @@ -3,8 +3,9 @@ package mocks import ( - pb "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" - mock "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/mock" + + "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" ) // AsyncDeleter is an autogenerated mock type for the asyncDeleter type diff --git a/pkg/mercury/orm.go b/pkg/mercury/moved/orm.go similarity index 98% rename from pkg/mercury/orm.go rename to pkg/mercury/moved/orm.go index 7423f55d5e..abb24babd6 100644 --- a/pkg/mercury/orm.go +++ b/pkg/mercury/moved/orm.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "context" @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" ) type ORM interface { diff --git a/pkg/mercury/orm_test.go b/pkg/mercury/moved/orm_test.go similarity index 99% rename from pkg/mercury/orm_test.go rename to pkg/mercury/moved/orm_test.go index 12a7832aa3..98ad485d87 100644 --- a/pkg/mercury/orm_test.go +++ b/pkg/mercury/moved/orm_test.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "math/rand/v2" diff --git a/pkg/mercury/persistence_manager.go b/pkg/mercury/moved/persistence_manager.go similarity index 99% rename from pkg/mercury/persistence_manager.go rename to pkg/mercury/moved/persistence_manager.go index 73853e40ad..e71328967c 100644 --- a/pkg/mercury/persistence_manager.go +++ b/pkg/mercury/moved/persistence_manager.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "context" @@ -10,7 +10,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" ) diff --git a/pkg/mercury/persistence_manager_test.go b/pkg/mercury/moved/persistence_manager_test.go similarity index 99% rename from pkg/mercury/persistence_manager_test.go rename to pkg/mercury/moved/persistence_manager_test.go index 7b78ab3225..8620c69fee 100644 --- a/pkg/mercury/persistence_manager_test.go +++ b/pkg/mercury/moved/persistence_manager_test.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "math/rand/v2" diff --git a/pkg/mercury/queue.go b/pkg/mercury/moved/queue.go similarity index 99% rename from pkg/mercury/queue.go rename to pkg/mercury/moved/queue.go index a07d2b8873..b33c64d406 100644 --- a/pkg/mercury/queue.go +++ b/pkg/mercury/moved/queue.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "context" diff --git a/pkg/mercury/queue_test.go b/pkg/mercury/moved/queue_test.go similarity index 97% rename from pkg/mercury/queue_test.go rename to pkg/mercury/moved/queue_test.go index cf82fed6b1..36b7612cdb 100644 --- a/pkg/mercury/queue_test.go +++ b/pkg/mercury/moved/queue_test.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "sync" @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/mocks" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/mocks" ) type TestTransmissionWithReport struct { diff --git a/pkg/mercury/transmitter.go b/pkg/mercury/moved/transmitter.go similarity index 99% rename from pkg/mercury/transmitter.go rename to pkg/mercury/moved/transmitter.go index 12f563e362..a01333d96b 100644 --- a/pkg/mercury/transmitter.go +++ b/pkg/mercury/moved/transmitter.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "bytes" @@ -32,7 +32,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" - mercuryutils "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" + mercuryutils "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" ) const ( diff --git a/pkg/mercury/transmitter_test.go b/pkg/mercury/moved/transmitter_test.go similarity index 99% rename from pkg/mercury/transmitter_test.go rename to pkg/mercury/moved/transmitter_test.go index 7440ab343e..a828948ffd 100644 --- a/pkg/mercury/transmitter_test.go +++ b/pkg/mercury/moved/transmitter_test.go @@ -1,4 +1,4 @@ -package mercury +package moved import ( "context" @@ -19,8 +19,8 @@ import ( "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/mocks" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc/pb" - mercurytypes "github.com/smartcontractkit/chainlink-evm/pkg/mercury/types" - mercuryutils "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" + mercurytypes "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/types" + mercuryutils "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) diff --git a/pkg/mercury/types/types.go b/pkg/mercury/moved/types/types.go similarity index 100% rename from pkg/mercury/types/types.go rename to pkg/mercury/moved/types/types.go diff --git a/pkg/mercury/utils/feeds.go b/pkg/mercury/moved/utils/feeds.go similarity index 100% rename from pkg/mercury/utils/feeds.go rename to pkg/mercury/moved/utils/feeds.go diff --git a/pkg/mercury/utils/feeds_test.go b/pkg/mercury/moved/utils/feeds_test.go similarity index 100% rename from pkg/mercury/utils/feeds_test.go rename to pkg/mercury/moved/utils/feeds_test.go diff --git a/pkg/mercury/v2/reportcodec/report_codec.go b/pkg/mercury/moved/v2/reportcodec/report_codec.go similarity index 94% rename from pkg/mercury/v2/reportcodec/report_codec.go rename to pkg/mercury/moved/v2/reportcodec/report_codec.go index 0b3449a1d5..7d1005f0e5 100644 --- a/pkg/mercury/v2/reportcodec/report_codec.go +++ b/pkg/mercury/moved/v2/reportcodec/report_codec.go @@ -12,8 +12,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" v2 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v2" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/v2/types" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/v2/types" ) var ReportTypes = reporttypes.GetSchema() diff --git a/pkg/mercury/v2/reportcodec/report_codec_test.go b/pkg/mercury/moved/v2/reportcodec/report_codec_test.go similarity index 100% rename from pkg/mercury/v2/reportcodec/report_codec_test.go rename to pkg/mercury/moved/v2/reportcodec/report_codec_test.go diff --git a/pkg/mercury/v2/types/types.go b/pkg/mercury/moved/v2/types/types.go similarity index 100% rename from pkg/mercury/v2/types/types.go rename to pkg/mercury/moved/v2/types/types.go diff --git a/pkg/mercury/v3/reportcodec/report_codec.go b/pkg/mercury/moved/v3/reportcodec/report_codec.go similarity index 94% rename from pkg/mercury/v3/reportcodec/report_codec.go rename to pkg/mercury/moved/v3/reportcodec/report_codec.go index d0ad90bc4e..06e4a39e62 100644 --- a/pkg/mercury/v3/reportcodec/report_codec.go +++ b/pkg/mercury/moved/v3/reportcodec/report_codec.go @@ -12,8 +12,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/v3/types" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/v3/types" ) var ReportTypes = reporttypes.GetSchema() diff --git a/pkg/mercury/v3/reportcodec/report_codec_test.go b/pkg/mercury/moved/v3/reportcodec/report_codec_test.go similarity index 100% rename from pkg/mercury/v3/reportcodec/report_codec_test.go rename to pkg/mercury/moved/v3/reportcodec/report_codec_test.go diff --git a/pkg/mercury/v3/types/types.go b/pkg/mercury/moved/v3/types/types.go similarity index 100% rename from pkg/mercury/v3/types/types.go rename to pkg/mercury/moved/v3/types/types.go diff --git a/pkg/mercury/v4/reportcodec/report_codec.go b/pkg/mercury/moved/v4/reportcodec/report_codec.go similarity index 94% rename from pkg/mercury/v4/reportcodec/report_codec.go rename to pkg/mercury/moved/v4/reportcodec/report_codec.go index 822020483f..2abb3fa0ba 100644 --- a/pkg/mercury/v4/reportcodec/report_codec.go +++ b/pkg/mercury/moved/v4/reportcodec/report_codec.go @@ -11,8 +11,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" v4 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v4" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/v4/types" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/utils" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved/v4/types" ) var ReportTypes = reporttypes.GetSchema() diff --git a/pkg/mercury/v4/reportcodec/report_codec_test.go b/pkg/mercury/moved/v4/reportcodec/report_codec_test.go similarity index 100% rename from pkg/mercury/v4/reportcodec/report_codec_test.go rename to pkg/mercury/moved/v4/reportcodec/report_codec_test.go diff --git a/pkg/mercury/v4/types/types.go b/pkg/mercury/moved/v4/types/types.go similarity index 100% rename from pkg/mercury/v4/types/types.go rename to pkg/mercury/moved/v4/types/types.go diff --git a/pkg/mercury/verifier/verifier.go b/pkg/mercury/moved/verifier/verifier.go similarity index 100% rename from pkg/mercury/verifier/verifier.go rename to pkg/mercury/moved/verifier/verifier.go diff --git a/pkg/mercury/verifier/verifier_test.go b/pkg/mercury/moved/verifier/verifier_test.go similarity index 97% rename from pkg/mercury/verifier/verifier_test.go rename to pkg/mercury/moved/verifier/verifier_test.go index 1ded2b2eff..ad926ec757 100644 --- a/pkg/mercury/verifier/verifier_test.go +++ b/pkg/mercury/moved/verifier/verifier_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-evm/pkg/mercury" + "github.com/smartcontractkit/chainlink-evm/pkg/mercury/moved" ) func Test_Verifier(t *testing.T) { @@ -16,7 +16,7 @@ func Test_Verifier(t *testing.T) { signedReportBinary := hexutil.MustDecode(`0x0006e1dde86b8a12add45546a14ea7e5efd10b67a373c6f4c41ecfa17d0005350000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002800001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000034c9214519c942ad0aa84a3dd31870e6efe8b3fcab4e176c5226879b26c77000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000669150aa0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c0000000000000000000000000000000000001504e1e6c380271bb8b129ac8f7c00000000000000000000000000000000000000000000000000000000669150ab0000000000000000000000000000000000000000000000000000002482116240000000000000000000000000000000000000000000000000000000247625a04000000000000000000000000000000000000000000000000000000024880743400000000000000000000000000000000000000000000000000000000000000002710ac21df88ab70c8822b68be53d7bed65c82ffc9204c1d7ccf3c6c4048b3ca2cafb26e7bbd8f13fe626c946baa5ffcb444319c4229b945ea65d0c99c21978a100000000000000000000000000000000000000000000000000000000000000022c07843f17aa3ecd55f52e99e889906f825f49e4ddfa9c74ca487dd4ff101cc636108a5323be838e658dffa1be67bd91e99f68c4bf86936b76c5d8193b707597`) m := make(map[string]any) - err := mercury.PayloadTypes.UnpackIntoMap(m, signedReportBinary) + err := moved.PayloadTypes.UnpackIntoMap(m, signedReportBinary) require.NoError(t, err) signedReport := SignedReport{ diff --git a/pkg/mercury/offchain_config_digester.go b/pkg/mercury/offchain_config_digester.go index 6e9c2089be..2ff9b26405 100644 --- a/pkg/mercury/offchain_config_digester.go +++ b/pkg/mercury/offchain_config_digester.go @@ -11,8 +11,6 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/wsrpc/credentials" - - "github.com/smartcontractkit/chainlink-evm/pkg/mercury/utils" ) // Originally sourced from: https://github.com/smartcontractkit/offchain-reporting/blob/991ebe1462fd56826a1ddfb34287d542acb2baee/lib/offchainreporting2/chains/evmutil/offchain_config_digester.go @@ -24,7 +22,7 @@ func NewOffchainConfigDigester(feedID [32]byte, chainID *big.Int, contractAddres } type OffchainConfigDigester struct { - FeedID utils.FeedID + FeedID common.Hash ChainID *big.Int ContractAddress common.Address Prefix ocrtypes.ConfigDigestPrefix @@ -55,7 +53,7 @@ func (d OffchainConfigDigester) ConfigDigest(ctx context.Context, cc ocrtypes.Co } return configDigest( - common.Hash(d.FeedID), + d.FeedID, d.ChainID, d.ContractAddress, cc.ConfigCount, diff --git a/pkg/mercury/test_helpers.go b/pkg/mercury/test_helpers.go deleted file mode 100644 index a18379499d..0000000000 --- a/pkg/mercury/test_helpers.go +++ /dev/null @@ -1,17 +0,0 @@ -package mercury - -import ( - "github.com/ethereum/go-ethereum/common/hexutil" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func MustHexToConfigDigest(s string) (cd ocrtypes.ConfigDigest) { - b := hexutil.MustDecode(s) - var err error - cd, err = ocrtypes.BytesToConfigDigest(b) - if err != nil { - panic(err) - } - return -}