chore: remove pointer.To in favour of new(T)#22444
Conversation
This is a cleanup of the `deployment` codebase to remove the use of `pointer.To` in favour of `new(T)`.
|
👋 jkongie, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
This PR attempts to remove the pointer.To[T](v T) *T helper across the deployment/ tree, replacing every pointer.To(v) call with new(v) and deleting the helper.
Risk Rating: HIGH — the change touches many packages and, as written, is not valid Go.
The substitution is incorrect: Go's built-in new accepts a type and returns a *T pointing to the zero value. It does not accept a value. So all of the rewrites in this PR (e.g. new(""), new(true), new(uint32(1)), new(devenv.LabelNodeTypeValueBootstrap), new(strconv.FormatUint(...)), new(configv2.LogLevel(...)), new(deployment.Version1_6_0.String()), etc.) will fail to compile. Even if some were rewritten with a valid type argument, the resulting pointer would target the zero value rather than the originally intended value, which is not equivalent to pointer.To.
Recommended path forward: revert the change. If pointer.To is undesirable, replace it with another value-taking generic helper (e.g. ptr.Of) — new cannot be used as a drop-in replacement.
Changes:
- Deletes
pointer.Tofromdeployment/helpers/pointer/pointer.go. - Removes
pointerimports across manydeployment/...files. - Replaces every
pointer.To(v)with the invalid expressionnew(v).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| deployment/helpers/pointer/pointer.go | Removes the To helper that callers still need. |
| deployment/utils/nodetestutils/node.go | Replaces pointer.To with invalid new(value) calls. |
| deployment/keystone/changeset/internal/remove_dons_test.go | Same invalid new(value) substitution. |
| deployment/internal/jdtestutils/client.go | Same invalid new(value) substitution. |
| deployment/internal/jdtestutils/client_test.go | Same invalid new(value) substitution. |
| deployment/environment/test/job_service_client_test.go | Many invalid new("...") substitutions. |
| deployment/data-feeds/offchain/jd.go | Invalid new(value) substitutions; also tidies struct literals. |
| deployment/data-feeds/changeset/jd_register_nodes.go | Invalid new(value) substitutions. |
| deployment/cre/pkg/offchain/propose_job.go | Invalid new(value) substitution. |
| deployment/cre/pkg/offchain/nodes.go | Invalid new(value) substitutions. |
| deployment/cre/jobs/operations/propose_std_cap_job.go | Invalid new(value) substitution. |
| deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go | Invalid new(value) substitutions. |
| deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go | Invalid new(value) substitutions. |
| deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go | Invalid new(value) substitutions. |
| deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config.go | Invalid new(value) substitutions in production code. |
| deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go | Invalid new(value) substitutions. |
| @@ -356,7 +355,7 @@ func WithFinalityDepths(finalityDepths map[uint64]uint32) ConfigOpt { | |||
| chainIDBig := sqlutil.New(new(big.Int).SetUint64(chainID)) | |||
| for _, evmChainConfig := range c.EVM { | |||
| if evmChainConfig.ChainID.ToInt().Cmp(chainIDBig.ToInt()) == 0 { | |||
| evmChainConfig.FinalityDepth = pointer.To(depth) | |||
| evmChainConfig.FinalityDepth = new(depth) | |||
| } | |||
| } | |||
| } | |||
| @@ -404,30 +403,30 @@ func NewNode( | |||
| // Do not want to load fixtures as they contain a dummy chainID. | |||
| // Create database and initial configuration. | |||
| cfg, db := heavyweight.FullTestDBNoFixturesV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { | |||
| c.Insecure.OCRDevelopmentMode = pointer.To(true) // Disables ocr spec validation so we can have fast polling for the test. | |||
| c.Insecure.OCRDevelopmentMode = new(true) // Disables ocr spec validation so we can have fast polling for the test. | |||
|
|
|||
| c.Feature.LogPoller = pointer.To(true) | |||
| c.Feature.LogPoller = new(true) | |||
|
|
|||
| // P2P V2 configs. | |||
| c.P2P.V2.Enabled = pointer.To(true) | |||
| c.P2P.V2.Enabled = new(true) | |||
| c.P2P.V2.DeltaDial = config.MustNewDuration(500 * time.Millisecond) | |||
| c.P2P.V2.DeltaReconcile = config.MustNewDuration(5 * time.Second) | |||
| c.P2P.V2.ListenAddresses = &[]string{fmt.Sprintf("127.0.0.1:%d", nodecfg.Port)} | |||
|
|
|||
| // Enable Capabilities, This is a pre-requisite for registrySyncer to work. | |||
| if nodecfg.RegistryConfig.Contract != common.HexToAddress("0x0") { | |||
| c.Capabilities.ExternalRegistry.NetworkID = pointer.To(relay.NetworkEVM) | |||
| c.Capabilities.ExternalRegistry.ChainID = pointer.To(strconv.FormatUint(nodecfg.RegistryConfig.EVMChainID, 10)) | |||
| c.Capabilities.ExternalRegistry.Address = pointer.To(nodecfg.RegistryConfig.Contract.String()) | |||
| c.Capabilities.ExternalRegistry.NetworkID = new(relay.NetworkEVM) | |||
| c.Capabilities.ExternalRegistry.ChainID = new(strconv.FormatUint(nodecfg.RegistryConfig.EVMChainID, 10)) | |||
| c.Capabilities.ExternalRegistry.Address = new(nodecfg.RegistryConfig.Contract.String()) | |||
| } | |||
|
|
|||
| // OCR configs | |||
| c.OCR.Enabled = pointer.To(false) | |||
| c.OCR.DefaultTransactionQueueDepth = pointer.To(uint32(200)) | |||
| c.OCR2.Enabled = pointer.To(true) | |||
| c.OCR.Enabled = new(false) | |||
| c.OCR.DefaultTransactionQueueDepth = new(uint32(200)) | |||
| c.OCR2.Enabled = new(true) | |||
| c.OCR2.ContractPollInterval = config.MustNewDuration(5 * time.Second) | |||
|
|
|||
| c.Log.Level = pointer.To(configv2.LogLevel(nodecfg.LogLevel)) | |||
| c.Log.Level = new(configv2.LogLevel(nodecfg.LogLevel)) | |||
| wantErr: true, | ||
| validateRemoval: false, | ||
| donToRemove: pointer.To(uint32(2839748937)), | ||
| donToRemove: new(uint32(2839748937)), |
| p2pIDLabel := &ptypes.Label{ | ||
| Key: "p2p_id", | ||
| Value: pointer.To(n.Keys.PeerID.String()), | ||
| Value: new(n.Keys.PeerID.String()), |
| { | ||
| Key: "label-key", | ||
| Value: pointer.To("label-value"), | ||
| Value: new("label-value"), |
| @@ -861,14 +859,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_EQ, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("NOT THE VALUE WE NEED"), | |||
| Value: new("NOT THE VALUE WE NEED"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -880,7 +878,7 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_EQ, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{}, | |||
| @@ -893,14 +891,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_EQ, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -912,14 +910,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_EQ, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("NOT THE VALUE WE NEED"), | |||
| Value: new("NOT THE VALUE WE NEED"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -931,7 +929,7 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_EQ, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{}, | |||
| @@ -944,14 +942,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_IN, | |||
| Value: pointer.To("value1,value2"), | |||
| Value: new("value1,value2"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -963,14 +961,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_IN, | |||
| Value: pointer.To("value1,value2"), | |||
| Value: new("value1,value2"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("NOT THE VALUE WE NEED"), | |||
| Value: new("NOT THE VALUE WE NEED"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -982,7 +980,7 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_IN, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{}, | |||
| @@ -995,14 +993,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_IN, | |||
| Value: pointer.To("value1,value2"), | |||
| Value: new("value1,value2"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -1014,14 +1012,14 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_IN, | |||
| Value: pointer.To("value1,value2"), | |||
| Value: new("value1,value2"), | |||
| }, | |||
| }, | |||
| job: &jobv1.Job{ | |||
| Labels: []*ptypes.Label{ | |||
| { | |||
| Key: "label1", | |||
| Value: pointer.To("NOT THE VALUE WE NEED"), | |||
| Value: new("NOT THE VALUE WE NEED"), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -1033,7 +1031,7 @@ func TestMatchesSelectors(t *testing.T) { | |||
| { | |||
| Key: "label1", | |||
| Op: ptypes.SelectorOp_NOT_IN, | |||
| Value: pointer.To("value1"), | |||
| Value: new("value1"), | |||
| @@ -1581,12 +1580,12 @@ func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangesetV2(t *testing.T) { | |||
| src: { | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_6.OptionalFeeQuoterTokenTransferFeeConfig{ | |||
| dstLinkTokenAddress: { | |||
| MinFeeUSDCents: pointer.To(uint32(1)), | |||
| MaxFeeUSDCents: pointer.To(uint32(2)), | |||
| DeciBps: pointer.To(uint16(1)), | |||
| DestGasOverhead: pointer.To(uint32(1)), | |||
| DestBytesOverhead: pointer.To(uint32(64)), | |||
| IsEnabled: pointer.To(true), | |||
| MinFeeUSDCents: new(uint32(1)), | |||
| MaxFeeUSDCents: new(uint32(2)), | |||
| DeciBps: new(uint16(1)), | |||
| DestGasOverhead: new(uint32(1)), | |||
| DestBytesOverhead: new(uint32(64)), | |||
| IsEnabled: new(true), | |||
| @@ -274,12 +273,12 @@ func TestSetTokenTransferFeeConfig_Execution_WithoutMCMS(t *testing.T) { | |||
| TokensToUseDefaultFeeConfigs: []common.Address{}, | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_5_1.TokenTransferFeeArgs{ | |||
| tokenA: { | |||
| MinFeeUSDCents: pointer.To(uint32(100)), | |||
| MaxFeeUSDCents: pointer.To(uint32(5000)), | |||
| DeciBps: pointer.To(uint16(25)), | |||
| DestGasOverhead: pointer.To(uint32(100_000)), | |||
| DestBytesOverhead: pointer.To(uint32(1200)), | |||
| AggregateRateLimitEnabled: pointer.To(true), | |||
| MinFeeUSDCents: new(uint32(100)), | |||
| MaxFeeUSDCents: new(uint32(5000)), | |||
| DeciBps: new(uint16(25)), | |||
| DestGasOverhead: new(uint32(100_000)), | |||
| DestBytesOverhead: new(uint32(1200)), | |||
| AggregateRateLimitEnabled: new(true), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -345,12 +344,12 @@ func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { | |||
| TokensToUseDefaultFeeConfigs: []common.Address{}, | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_5_1.TokenTransferFeeArgs{ | |||
| tokenA: { | |||
| MinFeeUSDCents: pointer.To(uint32(100)), | |||
| MaxFeeUSDCents: pointer.To(uint32(5000)), | |||
| DeciBps: pointer.To(uint16(25)), | |||
| DestGasOverhead: pointer.To(uint32(100_000)), | |||
| DestBytesOverhead: pointer.To(uint32(1200)), | |||
| AggregateRateLimitEnabled: pointer.To(true), | |||
| MinFeeUSDCents: new(uint32(100)), | |||
| MaxFeeUSDCents: new(uint32(5000)), | |||
| DeciBps: new(uint16(25)), | |||
| DestGasOverhead: new(uint32(100_000)), | |||
| DestBytesOverhead: new(uint32(1200)), | |||
| AggregateRateLimitEnabled: new(true), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -388,12 +387,12 @@ func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { | |||
| TokensToUseDefaultFeeConfigs: []common.Address{tokenB}, | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_5_1.TokenTransferFeeArgs{ | |||
| tokenA: { | |||
| MinFeeUSDCents: nil, // keep current | |||
| MaxFeeUSDCents: nil, // keep current | |||
| DeciBps: pointer.To(uint16(30)), // change | |||
| DestGasOverhead: nil, // keep current | |||
| DestBytesOverhead: nil, // keep current | |||
| AggregateRateLimitEnabled: nil, // keep current | |||
| MinFeeUSDCents: nil, // keep current | |||
| MaxFeeUSDCents: nil, // keep current | |||
| DeciBps: new(uint16(30)), // change | |||
| DestGasOverhead: nil, // keep current | |||
| DestBytesOverhead: nil, // keep current | |||
| AggregateRateLimitEnabled: nil, // keep current | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -459,12 +458,12 @@ func TestSetTokenTransferFeeConfig_MultipleChains(t *testing.T) { | |||
| TokensToUseDefaultFeeConfigs: []common.Address{tokenB}, | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_5_1.TokenTransferFeeArgs{ | |||
| tokenA: { | |||
| MinFeeUSDCents: pointer.To(uint32(101)), | |||
| MaxFeeUSDCents: pointer.To(uint32(5001)), | |||
| DeciBps: pointer.To(uint16(26)), | |||
| DestGasOverhead: pointer.To(uint32(110_000)), | |||
| DestBytesOverhead: pointer.To(uint32(1300)), | |||
| AggregateRateLimitEnabled: pointer.To(true), | |||
| MinFeeUSDCents: new(uint32(101)), | |||
| MaxFeeUSDCents: new(uint32(5001)), | |||
| DeciBps: new(uint16(26)), | |||
| DestGasOverhead: new(uint32(110_000)), | |||
| DestBytesOverhead: new(uint32(1300)), | |||
| AggregateRateLimitEnabled: new(true), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -474,12 +473,12 @@ func TestSetTokenTransferFeeConfig_MultipleChains(t *testing.T) { | |||
| TokensToUseDefaultFeeConfigs: []common.Address{tokenD}, | |||
| TokenTransferFeeConfigArgs: map[common.Address]v1_5_1.TokenTransferFeeArgs{ | |||
| tokenC: { | |||
| MinFeeUSDCents: pointer.To(uint32(202)), | |||
| MaxFeeUSDCents: pointer.To(uint32(6002)), | |||
| DeciBps: pointer.To(uint16(31)), | |||
| DestGasOverhead: pointer.To(uint32(120_000)), | |||
| DestBytesOverhead: pointer.To(uint32(1400)), | |||
| AggregateRateLimitEnabled: pointer.To(false), | |||
| MinFeeUSDCents: new(uint32(202)), | |||
| MaxFeeUSDCents: new(uint32(6002)), | |||
| DeciBps: new(uint16(31)), | |||
| DestGasOverhead: new(uint32(120_000)), | |||
| DestBytesOverhead: new(uint32(1400)), | |||
| AggregateRateLimitEnabled: new(false), | |||
| @@ -431,10 +430,10 @@ func doTestBilling(t *testing.T, mcms bool) { | |||
| evmChain2: { | |||
| TokenAddressToFeeConfig: map[solana.PublicKey]ccipChangesetSolana.OptionalFeeQuoterTokenTransferFeeConfig{ | |||
| tokenAddressB: { | |||
| MinFeeUsdcents: pointer.To(uint32(800)), | |||
| MaxFeeUsdcents: pointer.To(uint32(1600)), | |||
| DestGasOverhead: pointer.To(uint32(100)), | |||
| DestBytesOverhead: pointer.To(uint32(100)), | |||
| MinFeeUsdcents: new(uint32(800)), | |||
| MaxFeeUsdcents: new(uint32(1600)), | |||
| DestGasOverhead: new(uint32(100)), | |||
| DestBytesOverhead: new(uint32(100)), | |||
| Solana: new(ccip_cs_sol_v0_1_1.VersionSolanaV0_1_1), | ||
| Evm: new(deployment.Version1_6_0.String()), |
| @@ -251,8 +250,8 @@ func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { | |||
| MsgStr: "Unsupported Solana version hint fails fast", | |||
| Config: crossfamily.SetTokenTransferFeeConfigInput{ | |||
| VersionHints: &crossfamily.OptionalVersions{ | |||
| Evm: pointer.To(deployment.Version1_6_0.String()), | |||
| Solana: pointer.To("v0_0_9"), // bogus/unsupported | |||
| Evm: new(deployment.Version1_6_0.String()), | |||
| Solana: new("v0_0_9"), // bogus/unsupported | |||
| }, | |||
| InputsByChain: map[uint64]map[uint64]crossfamily.TokenTransferFeeConfigArgs{ | |||
| solSrc: { | |||
| @@ -326,15 +325,15 @@ func TestSetTokenTransferFeeConfig_EVM_V1_6_0_Only(t *testing.T) { | |||
| TokenAddressToFeeConfig: map[string]crossfamily.OptionalTokenTransferFeeConfig{ | |||
| link.Hex(): { | |||
| // partial fields: defaults should be auto-filled by the EVM changeset when none exist | |||
| MinFeeUsdCents: pointer.To(uint32(800)), | |||
| DestGasOverhead: pointer.To(uint32(100)), | |||
| MinFeeUsdCents: new(uint32(800)), | |||
| DestGasOverhead: new(uint32(100)), | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| VersionHints: &crossfamily.OptionalVersions{ | |||
| Evm: pointer.To(deployment.Version1_6_0.String()), | |||
| Evm: new(deployment.Version1_6_0.String()), | |||
| }, | |||
| MCMS: &SetTokenTransferFeeMcmsConfig, | |||
| } | |||
| @@ -417,19 +416,19 @@ func TestSetTokenTransferFeeConfig_EVM_V1_5_1_Only(t *testing.T) { | |||
| dst: { | |||
| TokenAddressToFeeConfig: map[string]crossfamily.OptionalTokenTransferFeeConfig{ | |||
| link.Hex(): { | |||
| DestBytesOverhead: pointer.To(uint32(32)), | |||
| DestGasOverhead: pointer.To(uint32(10)), | |||
| MaxFeeUsdCents: pointer.To(uint32(math.MaxUint32)), | |||
| MinFeeUsdCents: pointer.To(uint32(800)), | |||
| DeciBps: pointer.To(uint16(0)), | |||
| IsEnabled: pointer.To(true), | |||
| DestBytesOverhead: new(uint32(32)), | |||
| DestGasOverhead: new(uint32(10)), | |||
| MaxFeeUsdCents: new(uint32(math.MaxUint32)), | |||
| MinFeeUsdCents: new(uint32(800)), | |||
| DeciBps: new(uint16(0)), | |||
| IsEnabled: new(true), | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| VersionHints: &crossfamily.OptionalVersions{ | |||
| Evm: pointer.To(deployment.Version1_5_1.String()), | |||
| Evm: new(deployment.Version1_5_1.String()), | |||
| }, | |||
| MCMS: &SetTokenTransferFeeMcmsConfig, | |||
| } | |||
| @@ -504,19 +503,19 @@ func TestSetTokenTransferFeeConfig_Solana_V0_1_0_Only(t *testing.T) { | |||
| TokenAddressToFeeConfig: map[string]crossfamily.OptionalTokenTransferFeeConfig{ | |||
| tokenAddressX.String(): { | |||
| // partial fields: defaults should be auto-filled by the SOL changeset when none exist | |||
| DestGasOverhead: pointer.To(uint32(10)), | |||
| DestGasOverhead: new(uint32(10)), | |||
| }, | |||
| tokenAddressY.String(): { | |||
| // partial fields: defaults should be auto-filled by the SOL changeset when none exist | |||
| DestBytesOverhead: pointer.To(uint32(64)), | |||
| DestGasOverhead: pointer.To(uint32(10)), | |||
| DestBytesOverhead: new(uint32(64)), | |||
| DestGasOverhead: new(uint32(10)), | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| VersionHints: &crossfamily.OptionalVersions{ | |||
| Solana: pointer.To(ccip_cs_sol_v0_1_1.VersionSolanaV0_1_1), | |||
| Solana: new(ccip_cs_sol_v0_1_1.VersionSolanaV0_1_1), | |||
| }, | |||
| MCMS: &SetTokenTransferFeeMcmsConfig, | |||
| } | |||
| @@ -602,11 +601,11 @@ func TestSetTokenTransferFeeConfig_MixedFamilies_SingleApply(t *testing.T) { | |||
| evmDst: { | |||
| TokenAddressToFeeConfig: map[string]crossfamily.OptionalTokenTransferFeeConfig{ | |||
| link.Hex(): { | |||
| MinFeeUsdCents: pointer.To(uint32(12)), | |||
| DeciBps: pointer.To(uint16(7)), | |||
| DestGasOverhead: pointer.To(uint32(222)), | |||
| DestBytesOverhead: pointer.To(uint32(512)), | |||
| IsEnabled: pointer.To(true), | |||
| MinFeeUsdCents: new(uint32(12)), | |||
| DeciBps: new(uint16(7)), | |||
| DestGasOverhead: new(uint32(222)), | |||
| DestBytesOverhead: new(uint32(512)), | |||
| IsEnabled: new(true), | |||
| }, | |||
| }, | |||
| }, | |||
| @@ -617,18 +616,18 @@ func TestSetTokenTransferFeeConfig_MixedFamilies_SingleApply(t *testing.T) { | |||
| TokenAddressToFeeConfig: map[string]crossfamily.OptionalTokenTransferFeeConfig{ | |||
| mint.String(): { | |||
| // partial: defaults will fill any omitted fields | |||
| MinFeeUsdCents: pointer.To(uint32(900)), | |||
| DestGasOverhead: pointer.To(uint32(100)), | |||
| DestBytesOverhead: pointer.To(uint32(128)), | |||
| MinFeeUsdCents: new(uint32(900)), | |||
| DestGasOverhead: new(uint32(100)), | |||
| DestBytesOverhead: new(uint32(128)), | |||
| // DeciBps/IsEnabled left nil -> defaults (0 / true) | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| VersionHints: &crossfamily.OptionalVersions{ | |||
| Solana: pointer.To(ccip_cs_sol_v0_1_1.VersionSolanaV0_1_1), | |||
| Evm: pointer.To(deployment.Version1_6_0.String()), | |||
| Solana: new(ccip_cs_sol_v0_1_1.VersionSolanaV0_1_1), | |||
| Evm: new(deployment.Version1_6_0.String()), | |||
|




This is a cleanup of the
deploymentcodebase to remove the use ofpointer.Toin favour ofnew(T).