Skip to content

Commit 8080657

Browse files
bors[bot]m-Peter
andauthored
Merge #4126
4126: Add an extra parameter for runtime config in `NewCustomReusableCadenceRuntimePool` constructor r=janezpodhostnik a=m-Peter Prior to this change, an empty `runtime.Config{}` was used and there was no way to set a custom config. A similar improvement was done in this PR #3768 Co-authored-by: Ardit Marku <[email protected]>
2 parents dcb617f + ca65c0f commit 8080657

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

engine/execution/computation/computer/computer_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) {
603603
fvm.WithReusableCadenceRuntimePool(
604604
reusableRuntime.NewCustomReusableCadenceRuntimePool(
605605
0,
606+
runtime.Config{},
606607
func(_ runtime.Config) runtime.Runtime {
607608
return emittingRuntime
608609
})))
@@ -690,6 +691,7 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) {
690691
fvm.WithReusableCadenceRuntimePool(
691692
reusableRuntime.NewCustomReusableCadenceRuntimePool(
692693
0,
694+
runtime.Config{},
693695
func(_ runtime.Config) runtime.Runtime {
694696
return rt
695697
})))
@@ -789,6 +791,7 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) {
789791
fvm.WithReusableCadenceRuntimePool(
790792
reusableRuntime.NewCustomReusableCadenceRuntimePool(
791793
0,
794+
runtime.Config{},
792795
func(_ runtime.Config) runtime.Runtime {
793796
return rt
794797
})))

fvm/environment/system_contracts_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func TestSystemContractsInvoke(t *testing.T) {
5757
tracer := tracing.NewTracerSpan()
5858
runtimePool := reusableRuntime.NewCustomReusableCadenceRuntimePool(
5959
0,
60+
runtime.Config{},
6061
func(_ runtime.Config) runtime.Runtime {
6162
return &testutil.TestInterpreterRuntime{
6263
InvokeContractFunc: tc.contractFunction,

fvm/runtime/reusable_cadence_runtime.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ func NewReusableCadenceRuntimePool(
146146

147147
func NewCustomReusableCadenceRuntimePool(
148148
poolSize int,
149+
config runtime.Config,
149150
newCustomRuntime CadenceRuntimeConstructor,
150151
) ReusableCadenceRuntimePool {
151152
return newReusableCadenceRuntimePool(
152153
poolSize,
153-
runtime.Config{},
154+
config,
154155
newCustomRuntime,
155156
)
156157
}

0 commit comments

Comments
 (0)