Skip to content

Commit 9df5562

Browse files
committed
Merge remote-tracking branch 'origin/main' into canton
2 parents 54ddb7b + f040429 commit 9df5562

File tree

14 files changed

+108
-27
lines changed

14 files changed

+108
-27
lines changed

.changeset/afraid-parks-rush.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/public-mugs-agree.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/purple-trams-sort.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# chainlink-deployments-framework
22

3+
## 0.75.0
4+
5+
### Minor Changes
6+
7+
- [#670](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/670) [`0a320ef`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/0a320efc8afe4d52f6569b46ac81aa95ba7a14e4) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - feat(engine): allow configuration for SUI chain in test engine
8+
9+
### Patch Changes
10+
11+
- [#668](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/668) [`ff9c85a`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/ff9c85a1c09ec9ba78e3073758e64502381e7a58) Thanks [@jkongie](https://github.com/jkongie)! - Bump `go-ethereum` to v1.16.8
12+
13+
## 0.74.3
14+
15+
### Patch Changes
16+
17+
- [#660](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/660) [`a8928d5`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/a8928d583390d89d496eb20269ca949bb55a59db) Thanks [@ecPablo](https://github.com/ecPablo)! - fix: avoid loading proposal ctx if the provider is nil
18+
chore: add deprecation warning to mcmsv2 commands
19+
20+
- [#666](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/666) [`d5bcb7c`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/d5bcb7cdf936230ddfa5f1cbff7774b3e4864ea5) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - fix(jd): remove wsrpc from error message
21+
22+
- [#655](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/655) [`3791c84`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/3791c84cfd90e75e3b60261750e982ea5ac1a22d) Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - feat: log from, to and raw data in forktests
23+
24+
- [#658](https://github.com/smartcontractkit/chainlink-deployments-framework/pull/658) [`504cfaa`](https://github.com/smartcontractkit/chainlink-deployments-framework/commit/504cfaa183399c6d86ee4b36d71239518322c8f3) Thanks [@ecPablo](https://github.com/ecPablo)! - fix proposal analyzer render issues with array details
25+
326
## 0.74.2
427

528
### Patch Changes

engine/cld/environment/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func Load(
105105
)
106106
if err != nil {
107107
if errors.Is(err, offchain.ErrEndpointsRequired) {
108-
lggr.Warn("Skipping JD initialization: gRPC and wsRPC endpoints are not set in config")
108+
lggr.Warn("Skipping JD initialization: gRPC endpoint is not set in config")
109109
} else {
110110
return fdeployment.Environment{},
111111
fmt.Errorf("failed to load offchain client for environment %s: %w", envKey, err)

engine/cld/environment/fork.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func LoadFork(
122122
)
123123
if err != nil {
124124
if errors.Is(err, offchain.ErrEndpointsRequired) {
125-
lggr.Warn("Skipping JD initialization: gRPC and wsRPC endpoints are not set in config")
125+
lggr.Warn("Skipping JD initialization: gRPC endpoint is not set in config")
126126
} else {
127127
return ForkedEnvironment{}, fmt.Errorf("failed to load offchain client: %w", err)
128128
}

engine/cld/legacy/cli/mcmsv2/mcms_v2.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,9 @@ func buildMCMSv2AnalyzeProposalCmd(
833833
},
834834
RunE: func(cmd *cobra.Command, args []string) error {
835835
// Create config
836+
if proposalCtxProvider == nil {
837+
return errors.New("proposalCtxProvider is required, please provide one in the domain cli constructor")
838+
}
836839
cfgv2, err := newCfgv2(lggr, cmd, domain, proposalCtxProvider, acceptExpiredProposal)
837840
if err != nil {
838841
return fmt.Errorf("error creating config: %w", err)
@@ -1175,6 +1178,9 @@ func newCfgv2(lggr logger.Logger, cmd *cobra.Command, domain cldf_domain.Domain,
11751178
if err != nil {
11761179
return nil, fmt.Errorf("failed to provide proposal analysis context: %w", err)
11771180
}
1181+
if cfg.proposalCtx == nil {
1182+
return nil, errors.New("proposal analysis context provider returned nil context. Make sure the ProposalContextProvider is correctly initialized in your domain CLI on BuildMCMSv2Cmd()")
1183+
}
11781184
}
11791185

11801186
if flags.fork {
@@ -1518,7 +1524,7 @@ func getTimelockExecutorWithChainOverride(cfg *cfgv2, chainSelector types.ChainS
15181524
if err != nil {
15191525
return nil, fmt.Errorf("error getting sui metadata from proposal: %w", err)
15201526
}
1521-
entrypointEncoder := suibindings.NewCCIPEntrypointArgEncoder(metadata.AccountObj, metadata.DeployerStateObj)
1527+
entrypointEncoder := suibindings.NewCCIPEntrypointArgEncoder(metadata.RegistryObj, metadata.DeployerStateObj)
15221528
executor, err = sui.NewTimelockExecutor(chain.Client, chain.Signer, entrypointEncoder, metadata.McmsPackageID, metadata.RegistryObj, metadata.AccountObj)
15231529
if err != nil {
15241530
return nil, fmt.Errorf("error creating sui timelock executor: %w", err)

engine/test/environment/options.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var (
1717
newAptosContainerLoader = onchain.NewAptosContainerLoader
1818
newSolanaContainerLoader = onchain.NewSolanaContainerLoader
1919
newSuiContainerLoader = onchain.NewSuiContainerLoader
20+
newSuiContainerLoaderWithConfig = onchain.NewSuiContainerLoaderWithConfig
2021
newTonContainerLoader = onchain.NewTonContainerLoader
2122
newTonContainerLoaderWithConfig = onchain.NewTonContainerLoaderWithConfig
2223
newTronContainerLoader = onchain.NewTronContainerLoader
@@ -170,13 +171,28 @@ func WithSuiContainer(t *testing.T, selectors []uint64) LoadOpt {
170171
return withChainLoader(t, newSuiContainerLoader(), selectors)
171172
}
172173

174+
// WithSuiContainerWithConfig loads Sui blockchain container instances with custom configuration
175+
// for specified chain selectors.
176+
func WithSuiContainerWithConfig(t *testing.T, selectors []uint64, cfg onchain.SuiContainerConfig) LoadOpt {
177+
t.Helper()
178+
179+
return withChainLoader(t, newSuiContainerLoaderWithConfig(cfg), selectors)
180+
}
181+
173182
// WithSuiContainerN loads n Sui blockchain container instances.
174183
func WithSuiContainerN(t *testing.T, n int) LoadOpt {
175184
t.Helper()
176185

177186
return withChainLoaderN(t, newSuiContainerLoader(), n)
178187
}
179188

189+
// WithSuiContainerNWithConfig loads n Sui blockchain container instances with custom configuration.
190+
func WithSuiContainerNWithConfig(t *testing.T, n int, cfg onchain.SuiContainerConfig) LoadOpt {
191+
t.Helper()
192+
193+
return withChainLoaderN(t, newSuiContainerLoaderWithConfig(cfg), n)
194+
}
195+
180196
// WithLogger sets the logger for the environment.
181197
func WithLogger(lggr logger.Logger) LoadOpt {
182198
return func(cmps *components) error {

engine/test/onchain/sui.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
suiprov "github.com/smartcontractkit/chainlink-deployments-framework/chain/sui/provider"
1515
)
1616

17+
// SuiContainerConfig is the configuration for the Sui container loader.
18+
type SuiContainerConfig = suiprov.CTFChainProviderConfig
19+
1720
// NewSuiContainerLoader creates a new Sui chain loader with default configuration using CTF.
1821
func NewSuiContainerLoader() *ChainLoader {
1922
// Generate a random Sui Ed25519 private key for testing
@@ -34,6 +37,18 @@ func NewSuiContainerLoader() *ChainLoader {
3437
}
3538
}
3639

40+
// NewSuiContainerLoaderWithConfig creates a new Sui chain loader with the given configuration using CTF.
41+
func NewSuiContainerLoaderWithConfig(cfg SuiContainerConfig) *ChainLoader {
42+
return &ChainLoader{
43+
selectors: getTestSelectorsByFamily(chainselectors.FamilySui),
44+
factory: func(t *testing.T, selector uint64) (fchain.BlockChain, error) {
45+
t.Helper()
46+
47+
return suiprov.NewCTFChainProvider(t, selector, cfg).Initialize(t.Context())
48+
},
49+
}
50+
}
51+
3752
// randomSeed generates a random seed for the Sui Ed25519 private key.
3853
func suiRandomSeed() []byte {
3954
seed := make([]byte, ed25519.SeedSize)

engine/test/onchain/sui_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package onchain
22

33
import (
4+
"crypto/ed25519"
5+
"crypto/rand"
6+
"encoding/hex"
7+
"sync"
48
"testing"
59

610
chainselectors "github.com/smartcontractkit/chain-selectors"
711
"github.com/stretchr/testify/assert"
812
"github.com/stretchr/testify/require"
13+
14+
suiprov "github.com/smartcontractkit/chainlink-deployments-framework/chain/sui/provider"
915
)
1016

1117
func Test_NewSuiContainerLoader(t *testing.T) {
@@ -23,3 +29,34 @@ func Test_NewSuiContainerLoader(t *testing.T) {
2329
// but we can verify it exists.
2430
require.NotNil(t, loader.factory)
2531
}
32+
33+
func Test_NewSuiContainerLoaderWithConfig(t *testing.T) {
34+
t.Parallel()
35+
36+
// Generate a test private key
37+
seed := make([]byte, ed25519.SeedSize)
38+
_, err := rand.Read(seed)
39+
require.NoError(t, err)
40+
41+
seeded := ed25519.NewKeyFromSeed(seed)
42+
seedBytes := seeded[:32]
43+
testPrivateKey := hex.EncodeToString(seedBytes)
44+
45+
var once sync.Once
46+
47+
config := suiprov.CTFChainProviderConfig{
48+
Once: &once,
49+
DeployerSignerGen: suiprov.AccountGenPrivateKey(testPrivateKey),
50+
}
51+
52+
loader := NewSuiContainerLoaderWithConfig(config)
53+
require.NotNil(t, loader)
54+
55+
// Should have the same selectors as getTestSelectorsByFamily returns
56+
require.NotNil(t, loader.selectors)
57+
wantSelectors := getTestSelectorsByFamily(chainselectors.FamilySui)
58+
assert.Equal(t, wantSelectors, loader.selectors)
59+
60+
// Factory should be configured with the provided config
61+
require.NotNil(t, loader.factory)
62+
}

0 commit comments

Comments
 (0)