File tree 4 files changed +40
-2175
lines changed
4 files changed +40
-2175
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,35 @@ func FlowExecutionParameters(env templates.Environment) []byte {
188
188
func FlowServiceAccount (env templates.Environment ) []byte {
189
189
code := assets .MustAssetString (flowServiceAccountFilename )
190
190
191
+ if env .FlowExecutionParametersAddress == "" {
192
+
193
+ // Remove the import of FlowExecutionParameters
194
+ code = strings .ReplaceAll (
195
+ code ,
196
+ "import FlowExecutionParameters from \" FlowExecutionParameters\" " ,
197
+ "//import FlowExecutionParameters from \" FlowExecutionParameters\" " ,
198
+ )
199
+
200
+ // Replace the metering getter functions
201
+ code = strings .ReplaceAll (
202
+ code ,
203
+ "return FlowExecutionParameters.getExecutionEffortWeights()" ,
204
+ "return self.account.storage.copy<{UInt64: UInt64}>(from: /storage/executionEffortWeights) ?? panic(\" execution effort weights not set yet\" )" ,
205
+ )
206
+
207
+ code = strings .ReplaceAll (
208
+ code ,
209
+ "return FlowExecutionParameters.getExecutionMemoryWeights()" ,
210
+ "return self.account.storage.copy<{UInt64: UInt64}>(from: /storage/executionMemoryWeights) ?? panic(\" execution memory weights not set yet\" )" ,
211
+ )
212
+
213
+ code = strings .ReplaceAll (
214
+ code ,
215
+ "return FlowExecutionParameters.getExecutionMemoryLimit()" ,
216
+ "return self.account.storage.copy<UInt64>(from: /storage/executionMemoryLimit) ?? panic(\" execution memory limit not set yet\" )" ,
217
+ )
218
+ }
219
+
191
220
code = templates .ReplaceAddresses (code , env )
192
221
193
222
return []byte (code )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ toolchain go1.22.4
6
6
7
7
require (
8
8
github.com/kevinburke/go-bindata v3.24.0+incompatible
9
- github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2 -0.20240215153337-0be5cb4b4bc9
9
+ github.com/onflow/flow-core-contracts/lib/go/templates v1.4.1 -0.20250121150329-3add9787ef8b
10
10
github.com/onflow/flow-ft/lib/go/contracts v1.0.1
11
11
github.com/onflow/flow-nft/lib/go/contracts v1.2.2
12
12
github.com/stretchr/testify v1.9.0
@@ -37,9 +37,9 @@ require (
37
37
github.com/onflow/atree v0.8.0-rc.6 // indirect
38
38
github.com/onflow/cadence v1.0.0-preview.51 // indirect
39
39
github.com/onflow/crypto v0.25.1 // indirect
40
- github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 // indirect
40
+ github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
41
41
github.com/onflow/flow-go-sdk v1.0.0-preview.54 // indirect
42
- github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240213205729-48f42d9896f8 // indirect
42
+ github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
43
43
github.com/onflow/flow/protobuf/go/flow v0.4.3 // indirect
44
44
github.com/onflow/go-ethereum v1.13.4 // indirect
45
45
github.com/pelletier/go-toml v1.2.0 // indirect
You can’t perform that action at this time.
0 commit comments