Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Dec 8, 2022
1 parent a120c00 commit b67b65a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions command/rootchain/initcontracts/init_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func initializeCheckpointManager(txRelayer txrelayer.TxRelayer) error {
}

validatorSetMap, err := validatorSetToABISlice(allocs)

if err != nil {
return fmt.Errorf("failed to convert validators to map: %w", err)
}
Expand Down
7 changes: 4 additions & 3 deletions e2e-polybft/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ func TestE2E_CheckpointSubmission(t *testing.T) {
// wait for a couple of blocks
require.NoError(t, cluster.WaitForBlock(15, 1*time.Minute))

txRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithClient(cluster.Servers[0].JSONRPC()))
// query rootchain for current checkpoint block
txRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithIPAddress(cluster.Bridge.JSONRPCAddr()))
require.NoError(t, err)

checkpointBlockNumInput, err := currentCheckpointBlockNumMethod.Encode([]interface{}{})
Expand All @@ -192,8 +193,8 @@ func TestE2E_CheckpointSubmission(t *testing.T) {
checkpointBlockNumRaw, err := txRelayer.Call(rootchainSender, checkpointManagerAddr, checkpointBlockNumInput)
require.NoError(t, err)

latestCheckpointBlockNum, err := strconv.ParseUint(checkpointBlockNumRaw, 0, 64)
latestCheckpointBlockNum, err := strconv.ParseInt(checkpointBlockNumRaw, 0, 64)
require.NoError(t, err)

require.Equal(t, 10, latestCheckpointBlockNum)
require.Equal(t, int64(10), latestCheckpointBlockNum)
}
4 changes: 4 additions & 0 deletions e2e-polybft/framework/test-bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func (t *TestBridge) Stop() {
t.node = nil
}

func (t *TestBridge) JSONRPCAddr() string {
return fmt.Sprintf("http://%s:%d", hostIP, 8545)
}

// runCommand executes command with given arguments
func runCommand(binary string, args []string, stdout io.Writer) error {
var stdErr bytes.Buffer
Expand Down

0 comments on commit b67b65a

Please sign in to comment.