Skip to content
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

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

KonradStaniec
Copy link
Collaborator

No description provided.

@KonradStaniec KonradStaniec added the A:no-changelog changes that do not require changelog update label Dec 11, 2024
@KonradStaniec KonradStaniec requested a review from a team as a code owner December 11, 2024 12:58
@KonradStaniec KonradStaniec requested review from gitferry and Lazar955 and removed request for a team December 11, 2024 12:58
@@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
driverTempDir, err := os.MkdirTemp("", "test-app-event")
driverTempDir := t.TempDir()

replayerTempDir, err := os.MkdirTemp("", "test-app-event")
require.NoError(t, err)

defer os.RemoveAll(driverTempDir)
Copy link
Member

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

Copy link
Collaborator Author

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.

defer os.RemoveAll(replayerTempDir)
driver := NewBabylonAppDriver(t, driverTempDir, replayerTempDir)

for i := 0; i < 11; i++ {
Copy link
Member

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

Copy link
Collaborator Author

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

Copy link
Member

@gitferry gitferry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@KonradStaniec KonradStaniec merged commit ee74454 into main Dec 12, 2024
19 checks passed
@KonradStaniec KonradStaniec deleted the konradstaniec/add-sending-tx-to-replay-tests branch December 12, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:no-changelog changes that do not require changelog update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants