From aca537daff2cd5c01cc0f204b1b345a7e6c1385c Mon Sep 17 00:00:00 2001 From: amit-momin <108959691+amit-momin@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:04:20 -0600 Subject: [PATCH] Remove dependencies on services package in common (#11321) * Removed dependencies on services package in common * Marked json data type as deprecated and cleaned up test vars * Replaced json data type with alias --- common/txmgr/types/forwarder_manager.go | 4 +- common/txmgr/types/tx.go | 6 +- common/txmgr/types/tx_attempt_builder.go | 4 +- common/txmgr/types/tx_store.go | 3 - common/types/head_tracker.go | 6 +- core/chains/evm/txmgr/broadcaster_test.go | 4 +- core/chains/evm/txmgr/evm_tx_store.go | 7 +-- core/chains/evm/txmgr/transmitchecker_test.go | 6 +- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/keystore/keys/ethkey/key.go | 10 ++-- core/services/pg/datatypes/json.go | 56 +------------------ core/services/vrf/v2/integration_v2_test.go | 17 +++--- core/services/vrf/v2/listener_v2_test.go | 10 ++-- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- 18 files changed, 49 insertions(+), 102 deletions(-) diff --git a/common/txmgr/types/forwarder_manager.go b/common/txmgr/types/forwarder_manager.go index 8d58f91295e..4d70b730004 100644 --- a/common/txmgr/types/forwarder_manager.go +++ b/common/txmgr/types/forwarder_manager.go @@ -1,13 +1,13 @@ package types import ( + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/types" - "github.com/smartcontractkit/chainlink/v2/core/services" ) //go:generate mockery --quiet --name ForwarderManager --output ./mocks/ --case=underscore type ForwarderManager[ADDR types.Hashable] interface { - services.ServiceCtx + services.Service ForwarderFor(addr ADDR) (forwarder ADDR, err error) // Converts payload to be forwarder-friendly ConvertPayload(dest ADDR, origPayload []byte) ([]byte, error) diff --git a/common/txmgr/types/tx.go b/common/txmgr/types/tx.go index 11017bd0325..78f6fba4592 100644 --- a/common/txmgr/types/tx.go +++ b/common/txmgr/types/tx.go @@ -13,11 +13,11 @@ import ( "github.com/pkg/errors" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" clnull "github.com/smartcontractkit/chainlink/v2/core/null" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" ) // TxStrategy controls how txes are queued and sent @@ -210,7 +210,7 @@ type Tx[ // Marshalled TxMeta // Used for additional context around transactions which you want to log // at send time. - Meta *datatypes.JSON + Meta *sqlutil.JSON Subject uuid.NullUUID ChainID CHAIN_ID @@ -219,7 +219,7 @@ type Tx[ // TransmitChecker defines the check that should be performed before a transaction is submitted on // chain. - TransmitChecker *datatypes.JSON + TransmitChecker *sqlutil.JSON // Marks tx requiring callback SignalCallback bool diff --git a/common/txmgr/types/tx_attempt_builder.go b/common/txmgr/types/tx_attempt_builder.go index 887219c490e..75712fc0c37 100644 --- a/common/txmgr/types/tx_attempt_builder.go +++ b/common/txmgr/types/tx_attempt_builder.go @@ -3,10 +3,10 @@ package types import ( "context" + "github.com/smartcontractkit/chainlink-common/pkg/services" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services" ) // TxAttemptBuilder takes the base unsigned transaction + optional parameters (tx type, gas parameters) @@ -23,7 +23,7 @@ type TxAttemptBuilder[ FEE feetypes.Fee, // FEE - chain fee type ] interface { // interfaces for running the underlying estimator - services.ServiceCtx + services.Service types.HeadTrackable[HEAD, BLOCK_HASH] // NewTxAttempt builds a transaction using the configured transaction type and fee estimator (new estimation) diff --git a/common/txmgr/types/tx_store.go b/common/txmgr/types/tx_store.go index c2dfeee4146..f731031f926 100644 --- a/common/txmgr/types/tx_store.go +++ b/common/txmgr/types/tx_store.go @@ -9,7 +9,6 @@ import ( feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" - "github.com/smartcontractkit/chainlink/v2/core/services/pg" ) // TxStore is a superset of all the needed persistence layer methods @@ -118,8 +117,6 @@ type ReceiptPlus[R any] struct { FailOnRevert bool `db:"fail_on_revert"` } -type QueryerFunc = func(tx pg.Queryer) error - type ChainReceipt[TX_HASH, BLOCK_HASH types.Hashable] interface { GetStatus() uint64 GetTxHash() TX_HASH diff --git a/common/types/head_tracker.go b/common/types/head_tracker.go index 811298f8956..d8fa8011783 100644 --- a/common/types/head_tracker.go +++ b/common/types/head_tracker.go @@ -3,7 +3,7 @@ package types import ( "context" - "github.com/smartcontractkit/chainlink/v2/core/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // HeadTracker holds and stores the block experienced by a particular node in a thread safe manner. @@ -11,7 +11,7 @@ import ( // //go:generate mockery --quiet --name HeadTracker --output ../mocks/ --case=underscore type HeadTracker[H Head[BLOCK_HASH], BLOCK_HASH Hashable] interface { - services.ServiceCtx + services.Service // Backfill given a head will fill in any missing heads up to the given depth // (used for testing) Backfill(ctx context.Context, headWithChain H, depth uint) (err error) @@ -68,7 +68,7 @@ type NewHeadHandler[H Head[BLOCK_HASH], BLOCK_HASH Hashable] func(ctx context.Co // //go:generate mockery --quiet --name HeadBroadcaster --output ../mocks/ --case=underscore type HeadBroadcaster[H Head[BLOCK_HASH], BLOCK_HASH Hashable] interface { - services.ServiceCtx + services.Service BroadcastNewLongestChain(H) HeadBroadcasterRegistry[H, BLOCK_HASH] } diff --git a/core/chains/evm/txmgr/broadcaster_test.go b/core/chains/evm/txmgr/broadcaster_test.go index bf480c66af6..d1e26c6c969 100644 --- a/core/chains/evm/txmgr/broadcaster_test.go +++ b/core/chains/evm/txmgr/broadcaster_test.go @@ -22,6 +22,7 @@ import ( "go.uber.org/zap/zapcore" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" @@ -43,7 +44,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -255,7 +255,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { tr := int32(99) b, err := json.Marshal(txmgr.TxMeta{JobID: &tr}) require.NoError(t, err) - meta := datatypes.JSON(b) + meta := sqlutil.JSON(b) earlierEthTx := txmgr.Tx{ FromAddress: fromAddress, ToAddress: toAddress, diff --git a/core/chains/evm/txmgr/evm_tx_store.go b/core/chains/evm/txmgr/evm_tx_store.go index 0e08d32b77a..84fe9a02c6a 100644 --- a/core/chains/evm/txmgr/evm_tx_store.go +++ b/core/chains/evm/txmgr/evm_tx_store.go @@ -18,6 +18,7 @@ import ( pkgerrors "github.com/pkg/errors" nullv4 "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -27,7 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/pg" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -171,14 +171,14 @@ type DbEthTx struct { // Marshalled EvmTxMeta // Used for additional context around transactions which you want to log // at send time. - Meta *datatypes.JSON + Meta *sqlutil.JSON Subject uuid.NullUUID PipelineTaskRunID uuid.NullUUID MinConfirmations null.Uint32 EVMChainID utils.Big // TransmitChecker defines the check that should be performed before a transaction is submitted on // chain. - TransmitChecker *datatypes.JSON + TransmitChecker *sqlutil.JSON InitialBroadcastAt *time.Time // Marks tx requiring callback SignalCallback bool @@ -1451,7 +1451,6 @@ func (o *evmTxStore) UpdateTxFatalError(ctx context.Context, etx *Tx) error { } // Updates eth attempt from in_progress to broadcast. Also updates the eth tx to unconfirmed. -// One of the more complicated signatures. We have to accept variable pg.QOpt and QueryerFunc arguments func (o *evmTxStore) UpdateTxAttemptInProgressToBroadcast(ctx context.Context, etx *Tx, attempt TxAttempt, NewAttemptState txmgrtypes.TxAttemptState) error { var cancel context.CancelFunc ctx, cancel = o.mergeContexts(ctx) diff --git a/core/chains/evm/txmgr/transmitchecker_test.go b/core/chains/evm/txmgr/transmitchecker_test.go index b43fcb4f459..5ebf5f32e38 100644 --- a/core/chains/evm/txmgr/transmitchecker_test.go +++ b/core/chains/evm/txmgr/transmitchecker_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" @@ -29,7 +30,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" ) func TestFactory(t *testing.T) { @@ -192,7 +192,7 @@ func TestTransmitCheckers(t *testing.T) { b, err := json.Marshal(meta) require.NoError(t, err) - metaJson := datatypes.JSON(b) + metaJson := sqlutil.JSON(b) tx := txmgr.Tx{ FromAddress: common.HexToAddress("0xfe0629509E6CB8dfa7a99214ae58Ceb465d5b5A9"), @@ -296,7 +296,7 @@ func TestTransmitCheckers(t *testing.T) { b, err := json.Marshal(meta) require.NoError(t, err) - metaJson := datatypes.JSON(b) + metaJson := sqlutil.JSON(b) tx := txmgr.Tx{ FromAddress: common.HexToAddress("0xfe0629509E6CB8dfa7a99214ae58Ceb465d5b5A9"), diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 0d78e15d596..e9fa432d4cd 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -303,7 +303,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.9 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e // indirect + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 3dd48f7445a..3d9962474b9 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1464,8 +1464,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 h1:hJhuShYv9eUQxHJQdOmyEymVmApOrICrQdOY7kKQ5Io= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 h1:cyA1aW1PYrOLZAMaSmuH7U99QBTfrF59s+6uDxQgOr0= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg= diff --git a/core/services/keystore/keys/ethkey/key.go b/core/services/keystore/keys/ethkey/key.go index 4201251e34f..6335ed55adc 100644 --- a/core/services/keystore/keys/ethkey/key.go +++ b/core/services/keystore/keys/ethkey/key.go @@ -3,7 +3,7 @@ package ethkey import ( "time" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ) // NOTE: This model refers to the OLD key and is only used for migrations @@ -15,10 +15,10 @@ import ( type Key struct { ID int32 Address EIP55Address - JSON datatypes.JSON `json:"-"` - CreatedAt time.Time `json:"-"` - UpdatedAt time.Time `json:"-"` - DeletedAt *time.Time `json:"-"` + JSON sqlutil.JSON `json:"-"` + CreatedAt time.Time `json:"-"` + UpdatedAt time.Time `json:"-"` + DeletedAt *time.Time `json:"-"` // IsFunding marks the address as being used for rescuing the node and the pending transactions // Only one key can be IsFunding=true at a time. IsFunding bool diff --git a/core/services/pg/datatypes/json.go b/core/services/pg/datatypes/json.go index d84c89269cc..ac72a5a5ed4 100644 --- a/core/services/pg/datatypes/json.go +++ b/core/services/pg/datatypes/json.go @@ -1,59 +1,9 @@ package datatypes import ( - "database/sql/driver" - "encoding/json" - "errors" - "fmt" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ) // JSON defined JSON data type, need to implements driver.Valuer, sql.Scanner interface -type JSON json.RawMessage - -// Value return json value, implement driver.Valuer interface -func (j JSON) Value() (driver.Value, error) { - if len(j) == 0 { - return nil, nil - } - bytes, err := json.RawMessage(j).MarshalJSON() - return string(bytes), err -} - -// Scan scan value into Jsonb, implements sql.Scanner interface -func (j *JSON) Scan(value interface{}) error { - if value == nil { - *j = JSON("null") - return nil - } - var bytes []byte - switch v := value.(type) { - case []byte: - bytes = v - case string: - bytes = []byte(v) - default: - return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value)) - } - - result := json.RawMessage{} - err := json.Unmarshal(bytes, &result) - *j = JSON(result) - return err -} - -// MarshalJSON to output non base64 encoded []byte -func (j JSON) MarshalJSON() ([]byte, error) { - return json.RawMessage(j).MarshalJSON() -} - -// UnmarshalJSON to deserialize []byte -func (j *JSON) UnmarshalJSON(b []byte) error { - result := json.RawMessage{} - err := result.UnmarshalJSON(b) - *j = JSON(result) - return err -} - -func (j JSON) String() string { - return string(j) -} +// Deprecated: Use sqlutil.JSON instead +type JSON = sqlutil.JSON diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 6880fa17992..f57cb640f67 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -30,6 +30,7 @@ import ( "github.com/jmoiron/sqlx" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -70,7 +71,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/pg" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" @@ -2038,13 +2038,13 @@ func TestStartingCountsV1(t *testing.T) { } md1, err := json.Marshal(&m1) require.NoError(t, err) - md1_ := datatypes.JSON(md1) + md1SQL := sqlutil.JSON(md1) reqID2 := utils.PadByteToHash(0x11) m2 := txmgr.TxMeta{ RequestID: &reqID2, } md2, err := json.Marshal(&m2) - md2_ := datatypes.JSON(md2) + md2SQL := sqlutil.JSON(md2) require.NoError(t, err) chainID := utils.NewBig(testutils.SimulatedChainID) confirmedTxes := []txmgr.Tx{ @@ -2056,7 +2056,7 @@ func TestStartingCountsV1(t *testing.T) { InitialBroadcastAt: &b, CreatedAt: b, State: txmgrcommon.TxConfirmed, - Meta: &datatypes.JSON{}, + Meta: &sqlutil.JSON{}, EncodedPayload: []byte{}, ChainID: chainID.ToInt(), }, @@ -2068,7 +2068,7 @@ func TestStartingCountsV1(t *testing.T) { InitialBroadcastAt: &b, CreatedAt: b, State: txmgrcommon.TxConfirmed, - Meta: &md1_, + Meta: &md1SQL, EncodedPayload: []byte{}, ChainID: chainID.ToInt(), }, @@ -2080,7 +2080,7 @@ func TestStartingCountsV1(t *testing.T) { InitialBroadcastAt: &b, CreatedAt: b, State: txmgrcommon.TxConfirmed, - Meta: &md2_, + Meta: &md2SQL, EncodedPayload: []byte{}, ChainID: chainID.ToInt(), }, @@ -2092,7 +2092,7 @@ func TestStartingCountsV1(t *testing.T) { InitialBroadcastAt: &b, CreatedAt: b, State: txmgrcommon.TxConfirmed, - Meta: &md2_, + Meta: &md2SQL, EncodedPayload: []byte{}, ChainID: chainID.ToInt(), }, @@ -2105,6 +2105,7 @@ func TestStartingCountsV1(t *testing.T) { RequestID: &reqID3, }) require.NoError(t, err2) + mdSQL := sqlutil.JSON(md) newNonce := evmtypes.Nonce(i + 1) unconfirmedTxes = append(unconfirmedTxes, txmgr.Tx{ Sequence: &newNonce, @@ -2114,7 +2115,7 @@ func TestStartingCountsV1(t *testing.T) { State: txmgrcommon.TxUnconfirmed, BroadcastAt: &b, InitialBroadcastAt: &b, - Meta: (*datatypes.JSON)(&md), + Meta: &mdSQL, EncodedPayload: []byte{}, ChainID: chainID.ToInt(), }) diff --git a/core/services/vrf/v2/listener_v2_test.go b/core/services/vrf/v2/listener_v2_test.go index 17615feb63a..513aa01ef65 100644 --- a/core/services/vrf/v2/listener_v2_test.go +++ b/core/services/vrf/v2/listener_v2_test.go @@ -17,9 +17,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/pg/datatypes" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -77,7 +77,7 @@ func addEthTx(t *testing.T, txStore txmgr.TestEvmTxStore, from common.Address, s RequestTxHash: &reqTxHash, }) require.NoError(t, err) - meta := datatypes.JSON(b) + meta := sqlutil.JSON(b) tx := &txmgr.Tx{ FromAddress: from, ToAddress: from, @@ -103,7 +103,7 @@ func addConfirmedEthTx(t *testing.T, txStore txmgr.TestEvmTxStore, from common.A GlobalSubID: txMetaGlobalSubID, }) require.NoError(t, err) - meta := datatypes.JSON(b) + meta := sqlutil.JSON(b) now := time.Now() tx := &txmgr.Tx{ @@ -135,7 +135,7 @@ func addEthTxNativePayment(t *testing.T, txStore txmgr.TestEvmTxStore, from comm RequestTxHash: &reqTxHash, }) require.NoError(t, err) - meta := datatypes.JSON(b) + meta := sqlutil.JSON(b) tx := &txmgr.Tx{ FromAddress: from, ToAddress: from, @@ -161,7 +161,7 @@ func addConfirmedEthTxNativePayment(t *testing.T, txStore txmgr.TestEvmTxStore, GlobalSubID: txMetaGlobalSubID, }) require.NoError(t, err) - meta := datatypes.JSON(b) + meta := sqlutil.JSON(b) now := time.Now() tx := &txmgr.Tx{ Sequence: &nonce, diff --git a/go.mod b/go.mod index b3bdeb74cf1..e6bb7347ffd 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 diff --git a/go.sum b/go.sum index bdfbe2107ec..24d662390d0 100644 --- a/go.sum +++ b/go.sum @@ -1465,8 +1465,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 h1:hJhuShYv9eUQxHJQdOmyEymVmApOrICrQdOY7kKQ5Io= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 h1:cyA1aW1PYrOLZAMaSmuH7U99QBTfrF59s+6uDxQgOr0= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index cdd42deda7b..d626b38cca4 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -23,7 +23,7 @@ require ( github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 - github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 github.com/smartcontractkit/chainlink-testing-framework v1.19.1 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 08b772c9cec..b8a84de26ed 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2369,8 +2369,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459 h1:hJhuShYv9eUQxHJQdOmyEymVmApOrICrQdOY7kKQ5Io= github.com/smartcontractkit/chainlink-automation v1.0.0-alpha.0.0.20231120164534-d4cab696c459/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= -github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3 h1:cyA1aW1PYrOLZAMaSmuH7U99QBTfrF59s+6uDxQgOr0= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231121180428-d7f28e91ccc3/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg=