|
1 | 1 | package setconfig_test |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "context" |
4 | 5 | "crypto/ecdsa" |
5 | 6 | "testing" |
6 | 7 | "time" |
7 | 8 |
|
| 9 | + "github.com/Masterminds/semver/v3" |
8 | 10 | "github.com/ethereum/go-ethereum/common" |
9 | 11 | "github.com/stretchr/testify/require" |
10 | 12 |
|
| 13 | + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" |
11 | 14 | cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" |
| 15 | + cldfsol "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" |
12 | 16 | cldfdatastore "github.com/smartcontractkit/chainlink-deployments-framework/datastore" |
| 17 | + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" |
13 | 18 | cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" |
14 | 19 | mcmscontracts "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/contracts/mcms" |
15 | 20 | cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" |
@@ -146,6 +151,42 @@ func evmMCMSChainState(t *testing.T, rt *runtime.Runtime, selector uint64) (*evm |
146 | 151 | return mcmsState, chain |
147 | 152 | } |
148 | 153 |
|
| 154 | +// newSolanaVerifyPreconditionsEnv builds a mock Solana environment for VerifyPreconditions |
| 155 | +// only — no CTF container or on-chain deploy. |
| 156 | +func newSolanaVerifyPreconditionsEnv(t *testing.T, selector uint64) cldf.Environment { |
| 157 | + t.Helper() |
| 158 | + |
| 159 | + ds := datastore.NewMemoryDataStore() |
| 160 | + version := semver.MustParse("1.0.0") |
| 161 | + for _, ref := range []struct { |
| 162 | + contractType cldf.ContractType |
| 163 | + address string |
| 164 | + }{ |
| 165 | + {mcmscontracts.RBACTimelock, "timelock-address"}, |
| 166 | + {mcmscontracts.ProposerManyChainMultisig, "proposer-address"}, |
| 167 | + {mcmscontracts.CancellerManyChainMultisig, "canceller-address"}, |
| 168 | + {mcmscontracts.BypasserManyChainMultisig, "bypasser-address"}, |
| 169 | + } { |
| 170 | + require.NoError(t, ds.Addresses().Add(datastore.AddressRef{ |
| 171 | + Address: ref.address, |
| 172 | + ChainSelector: selector, |
| 173 | + Type: datastore.ContractType(ref.contractType), |
| 174 | + Version: version, |
| 175 | + })) |
| 176 | + } |
| 177 | + |
| 178 | + return cldf.Environment{ |
| 179 | + Logger: logger.Test(t), |
| 180 | + DataStore: ds.Seal(), |
| 181 | + GetContext: func() context.Context { |
| 182 | + return t.Context() |
| 183 | + }, |
| 184 | + BlockChains: cldf_chain.NewBlockChains(map[uint64]cldf_chain.BlockChain{ |
| 185 | + selector: cldfsol.Chain{Selector: selector}, |
| 186 | + }), |
| 187 | + } |
| 188 | +} |
| 189 | + |
149 | 190 | func newSolanaRuntimeWithDeploy(t *testing.T, selector uint64) *runtime.Runtime { |
150 | 191 | t.Helper() |
151 | 192 |
|
|
0 commit comments