Skip to content

Commit bb59c1b

Browse files
committed
chore: fix merge, typo and lint
Signed-off-by: gfanton <[email protected]>
1 parent 9560b64 commit bb59c1b

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

contribs/gnodev/pkg/dev/node_test.go

+14-22
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ func Render(_ string) string { return str }
204204
},
205205
}
206206

207-
// Call NewDevNode with no package should work
208207
node, emitter := newTestingDevNode(t, &fooPkg)
209208
assert.Len(t, node.ListPkgs(), 1)
210209

@@ -245,33 +244,24 @@ func Render(_ string) string { return str }
245244
}
246245

247246
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
252254
import "strconv"
253255
254256
var i int
255257
func Inc() { i++ } // method to increment i
256258
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+
}
273263

274-
node, emitter := newTestingDevNodeWithConfig(t, cfg)
264+
node, emitter := newTestingDevNode(t, &fooPkg)
275265
assert.Len(t, node.ListPkgs(), 1)
276266

277267
// Test rendering
@@ -324,6 +314,8 @@ func Render(_ string) string { return strconv.Itoa(i) }
324314
// Check for correct render update
325315
render, err = testingRenderRealm(t, node, "gno.land/r/dev/foo")
326316
require.NoError(t, err)
317+
318+
// Assert that the previous transaction hasn't succeeded during genesis reload
327319
require.Equal(t, "1", render)
328320
}
329321

0 commit comments

Comments
 (0)