-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Konradstaniec/add sending tx to replay tests #340
Konradstaniec/add sending tx to replay tests #340
Conversation
test/replay/app_replay_e2e_test.go
Outdated
@@ -478,3 +648,41 @@ func TestReplayBlocks(t *testing.T) { | |||
require.Equal(t, driver.LastState.LastBlockHeight, replayer.LastState.LastBlockHeight) | |||
require.Equal(t, driver.LastState.AppHash, replayer.LastState.AppHash) | |||
} | |||
|
|||
func TestSendingTxFromDriverAccount(t *testing.T) { | |||
driverTempDir, err := os.MkdirTemp("", "test-app-event") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
driverTempDir, err := os.MkdirTemp("", "test-app-event") | |
driverTempDir := t.TempDir() |
test/replay/app_replay_e2e_test.go
Outdated
replayerTempDir, err := os.MkdirTemp("", "test-app-event") | ||
require.NoError(t, err) | ||
|
||
defer os.RemoveAll(driverTempDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with t.TempDir()
we don't have to remove dir, they get rm after test finishes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good !
Though defer
has this advantage that it is also run if code in test panics for whatever reason, and TempDir
register cleanup in internal cleanups
list which may not run in case of panic.
test/replay/app_replay_e2e_test.go
Outdated
defer os.RemoveAll(replayerTempDir) | ||
driver := NewBabylonAppDriver(t, driverTempDir, replayerTempDir) | ||
|
||
for i := 0; i < 11; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe const the number 11 to denote what it means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh good point :) this is to go over the epoch boundary and see that our checkpointing is working as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
No description provided.