From c020d957f1835b2d08205c7095a5e5d746850b1a Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Thu, 20 Jun 2024 22:12:26 -0700 Subject: [PATCH] change blsagg_test to use AdvanceChainByNBlocksExecInContainer fct which doesn't need cast to be installed locally --- services/bls_aggregation/blsagg_test.go | 2 +- testutils/anvil.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/bls_aggregation/blsagg_test.go b/services/bls_aggregation/blsagg_test.go index c87159d9..ed7c45b8 100644 --- a/services/bls_aggregation/blsagg_test.go +++ b/services/bls_aggregation/blsagg_test.go @@ -839,7 +839,7 @@ func TestIntegrationBlsAgg(t *testing.T) { blsKeyPair, quorumNumbers, "socket", ) require.NoError(t, err) - testutils.AdvanceChainByNBlocks(1, anvilHttpEndpoint) + testutils.AdvanceChainByNBlocksExecInContainer(context.TODO(), 1, anvilC) curBlockNum, err = ethHttpClient.BlockNumber(context.Background()) referenceBlockNumber := uint32(curBlockNum) - 1 diff --git a/testutils/anvil.go b/testutils/anvil.go index c8a084e5..f7fb6d20 100644 --- a/testutils/anvil.go +++ b/testutils/anvil.go @@ -133,7 +133,7 @@ func AdvanceChainByNBlocks(n int, anvilEndpoint string) { } } -// AdvanceChainByNBlocks requires cast to be installed on the host machine, whereas this one doesn't. +// Prefer this function over AdvanceChainByNBlocks b/c it doesn't require cast to be installed on the host machine, whereas this one doesn't. func AdvanceChainByNBlocksExecInContainer(ctx context.Context, n int, anvilC testcontainers.Container) { c, _, err := anvilC.Exec(ctx, []string{"cast", "rpc", "anvil_mine", fmt.Sprintf("%d", n), "--rpc-url", "http://localhost:8545"}) if err != nil {