Skip to content

Commit

Permalink
Extract logs count to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed May 28, 2024
1 parent bb06c0d commit 4982058
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions e2e-polybft/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,8 @@ func TestE2E_Bridge_NonMintableERC20Token_WithPremine(t *testing.T) {
})

t.Run("transfer more native tokens than 0x0 balance is", func(t *testing.T) {
const expectedStateSyncsCount = 1

// since bridging native token is essentially minting
// (i.e. transferring tokens from 0x0 to receiver address using native transfer precompile),
// this test tries to deposit more tokens than 0x0 address has on its balance
Expand Down Expand Up @@ -1496,9 +1498,9 @@ func TestE2E_Bridge_NonMintableERC20Token_WithPremine(t *testing.T) {
logs, err := getFilteredLogs(stateSyncedResult.Sig(), currentBlock.Number()+1, finalBlockNum+i*epochSize, childEthEndpoint)
require.NoError(t, err)

if len(logs) == 1 || i == numberOfAttempts-1 {
if len(logs) == expectedStateSyncsCount || i == numberOfAttempts-1 {
// assert that sent deposit has failed
checkStateSyncResultLogs(t, logs, len(logs),
checkStateSyncResultLogs(t, logs, expectedStateSyncsCount,
func(t *testing.T, ssre contractsapi.StateSyncResultEvent) {
t.Helper()

Expand Down

0 comments on commit 4982058

Please sign in to comment.