From aff8d68187b0199a490ec6978330299e2198b2bf Mon Sep 17 00:00:00 2001 From: Graham Goh Date: Mon, 16 Dec 2024 14:47:05 +1100 Subject: [PATCH] feat(job-distributor): support tron chain type on sync Able to sync TRON chain type from core node to JD JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1332 --- .changeset/brave-cooks-itch.md | 5 +++++ core/services/feeds/models.go | 4 ++++ core/services/feeds/models_test.go | 5 +++++ go.mod | 2 +- go.sum | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .changeset/brave-cooks-itch.md diff --git a/.changeset/brave-cooks-itch.md b/.changeset/brave-cooks-itch.md new file mode 100644 index 00000000000..96a91cc263c --- /dev/null +++ b/.changeset/brave-cooks-itch.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +feat(job-distributor): support tron chain type on sync diff --git a/core/services/feeds/models.go b/core/services/feeds/models.go index 93dddd86dae..a6cf103b4e9 100644 --- a/core/services/feeds/models.go +++ b/core/services/feeds/models.go @@ -12,6 +12,7 @@ import ( "gopkg.in/guregu/null.v4" proto "github.com/smartcontractkit/chainlink-protos/orchestrator/feedsmanager" + "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" ) @@ -82,6 +83,7 @@ const ( ChainTypeEVM ChainType = "EVM" ChainTypeSolana ChainType = "SOLANA" ChainTypeStarknet ChainType = "STARKNET" + ChainTypeTron ChainType = "TRON" ) func NewChainType(s string) (ChainType, error) { @@ -94,6 +96,8 @@ func NewChainType(s string) (ChainType, error) { return ChainTypeSolana, nil case "APTOS": return ChainTypeAptos, nil + case "TRON": + return ChainTypeTron, nil default: return ChainTypeUnknown, errors.New("invalid chain type") } diff --git a/core/services/feeds/models_test.go b/core/services/feeds/models_test.go index 13567281735..d0d4382b055 100644 --- a/core/services/feeds/models_test.go +++ b/core/services/feeds/models_test.go @@ -28,6 +28,11 @@ func Test_NewChainType(t *testing.T) { give: "STARKNET", want: ChainTypeStarknet, }, + { + name: "Tron Chain Type", + give: "TRON", + want: ChainTypeTron, + }, { name: "Invalid Chain Type", give: "", diff --git a/go.mod b/go.mod index 40d62c74e34..82a1635dd19 100644 --- a/go.mod +++ b/go.mod @@ -83,7 +83,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241202141438-a90db35252db github.com/smartcontractkit/chainlink-feeds v0.1.1 - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.2 + github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241210172617-6fd1891d0fbc github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/go.sum b/go.sum index 81ae439a469..ce79da6c25d 100644 --- a/go.sum +++ b/go.sum @@ -1151,6 +1151,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.2 h1:onBe3DqNrbtOAzKS4PrPIiJX65BGo1aYiYZxFVEW+jc= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.2/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241210172617-6fd1891d0fbc h1:dssRwJhmzJkUN/OajaDj2GsxBn+Tupk3bI1BkPEoJg0= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241210172617-6fd1891d0fbc/go.mod h1:p8aUDfJeley6oer7y+Ucd3edOtRlMTnWg3mN6rhaLWo= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4=