@@ -204,7 +204,6 @@ func Render(_ string) string { return str }
204
204
},
205
205
}
206
206
207
- // Call NewDevNode with no package should work
208
207
node , emitter := newTestingDevNode (t , & fooPkg )
209
208
assert .Len (t , node .ListPkgs (), 1 )
210
209
@@ -245,33 +244,24 @@ func Render(_ string) string { return str }
245
244
}
246
245
247
246
func TestTxGasFailure (t * testing.T ) {
248
- const (
249
- // foo package
250
- foobarGnoMod = "module gno.land/r/dev/foo\n "
251
- fooFile = `package foo
247
+ fooPkg := gnovm.MemPackage {
248
+ Name : "foo" ,
249
+ Path : "gno.land/r/dev/foo" ,
250
+ Files : []* gnovm.MemFile {
251
+ {
252
+ Name : "foo.gno" ,
253
+ Body : `package foo
252
254
import "strconv"
253
255
254
256
var i int
255
257
func Inc() { i++ } // method to increment i
256
258
func Render(_ string) string { return strconv.Itoa(i) }
257
- `
258
- )
259
-
260
- // Generate package foo
261
- foopkg := generateTestingPackage (t , "gno.mod" , foobarGnoMod , "foo.gno" , fooFile )
262
-
263
- // Call NewDevNode with no package should work
264
- // Call NewDevNode with no package should work
265
- cfg := createDefaultTestingNodeConfig (foopkg )
266
-
267
- // XXX(gfanton): Setting this to `false` somehow makes the time block
268
- // drift from the time spanned by the VM.
269
- cfg .TMConfig .Consensus .SkipTimeoutCommit = false
270
- cfg .TMConfig .Consensus .TimeoutCommit = 500 * time .Millisecond
271
- cfg .TMConfig .Consensus .TimeoutPropose = 100 * time .Millisecond
272
- cfg .TMConfig .Consensus .CreateEmptyBlocks = true
259
+ ` ,
260
+ },
261
+ },
262
+ }
273
263
274
- node , emitter := newTestingDevNodeWithConfig (t , cfg )
264
+ node , emitter := newTestingDevNode (t , & fooPkg )
275
265
assert .Len (t , node .ListPkgs (), 1 )
276
266
277
267
// Test rendering
@@ -324,6 +314,8 @@ func Render(_ string) string { return strconv.Itoa(i) }
324
314
// Check for correct render update
325
315
render , err = testingRenderRealm (t , node , "gno.land/r/dev/foo" )
326
316
require .NoError (t , err )
317
+
318
+ // Assert that the previous transaction hasn't succeeded during genesis reload
327
319
require .Equal (t , "1" , render )
328
320
}
329
321
0 commit comments