Skip to content

Commit 5220e9a

Browse files
[CLD-672]: feat(engine): support in memory catalog for test runtime (#517)
Creating the test runtime engine will now use the in memory catalog client by default JIRA: https://smartcontract-it.atlassian.net/browse/CLD-672
1 parent 40a0e61 commit 5220e9a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.changeset/two-onions-march.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": minor
3+
---
4+
5+
feat(engine/test): support memory catalog

engine/test/environment/environment.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ package environment
55
import (
66
"context"
77
"errors"
8+
"fmt"
89
"sync"
910

1011
fchain "github.com/smartcontractkit/chainlink-deployments-framework/chain"
1112
fdatastore "github.com/smartcontractkit/chainlink-deployments-framework/datastore"
13+
fcatalog "github.com/smartcontractkit/chainlink-deployments-framework/datastore/catalog/memory"
1214
fdeployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
1315
focr "github.com/smartcontractkit/chainlink-deployments-framework/offchain/ocr"
1416
foperations "github.com/smartcontractkit/chainlink-deployments-framework/operations"
@@ -65,13 +67,18 @@ func (l *Loader) Load(ctx context.Context, opts ...LoadOpt) (*fdeployment.Enviro
6567
// We may want to set a default memory based offchain client in the future.
6668
oc := cmps.OffchainClient
6769

70+
catalog, err := fcatalog.NewMemoryCatalogDataStore()
71+
if err != nil {
72+
return nil, fmt.Errorf("failed to create in-memory catalog: %w", err)
73+
}
74+
6875
return &fdeployment.Environment{
6976
Name: environmentName,
7077
Logger: cmps.Logger,
7178
BlockChains: fchain.NewBlockChainsFromSlice(cmps.Chains),
7279
ExistingAddresses: ab,
7380
DataStore: ds,
74-
Catalog: nil, // Unimplemented for now
81+
Catalog: catalog,
7582
NodeIDs: nodeIDs,
7683
Offchain: oc,
7784
GetContext: getCtx,

engine/test/environment/environment_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestLoader_Load_Options(t *testing.T) {
9595
} else {
9696
require.NoError(t, err)
9797
require.NotNil(t, env)
98+
require.NotNil(t, env.Catalog) // Catalog should always be initialized
9899
}
99100
})
100101
}

0 commit comments

Comments
 (0)