diff --git a/tests/interchaintest/helpers/oracle.go b/tests/interchaintest/helpers/oracle.go index d952b0ad..65bf086e 100644 --- a/tests/interchaintest/helpers/oracle.go +++ b/tests/interchaintest/helpers/oracle.go @@ -5,18 +5,19 @@ import ( "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" ) + const validatorKeyName = "validator" -func ExecOracleMsgAggragatePrevote(ctx context.Context, validator *cosmos.ChainNode, salt string, exchangeRate string) (error) { + +func ExecOracleMsgAggragatePrevote(ctx context.Context, validator *cosmos.ChainNode, salt string, exchangeRate string) error { args := []string{ - "oracle", "aggregate-prevote", - salt, + "oracle", "aggregate-prevote", + salt, exchangeRate, - } command := validator.TxCommand(validatorKeyName, args...) - _, _, err := validator.Exec(ctx, command, nil) + _, _, err := validator.Exec(ctx, command, nil) if err != nil { return err } @@ -25,17 +26,16 @@ func ExecOracleMsgAggragatePrevote(ctx context.Context, validator *cosmos.ChainN func ExecOracleMsgAggregateVote(ctx context.Context, validator *cosmos.ChainNode, salt string, exchangeRate string) error { args := []string{ - "oracle", "aggregate-vote", - salt, + "oracle", "aggregate-vote", + salt, exchangeRate, - } command := validator.TxCommand(validatorKeyName, args...) - _, _, err := validator.Exec(ctx, command, nil) + _, _, err := validator.Exec(ctx, command, nil) if err != nil { return err } return nil -} \ No newline at end of file +} diff --git a/tests/interchaintest/oracle_test.go b/tests/interchaintest/oracle_test.go index 8ae4f1c6..2bf92260 100644 --- a/tests/interchaintest/oracle_test.go +++ b/tests/interchaintest/oracle_test.go @@ -83,7 +83,7 @@ func TestOracle(t *testing.T) { val := val go func(validator *cosmos.ChainNode) { defer wg.Done() - for i := 0; i < 2; i++ { + for i := 0; i < 6; i++ { if err := helpers.ExecOracleMsgAggragatePrevote(ctx, validator, "salt", "1.123uusd"); err != nil { oracleErrCh <- err return @@ -92,14 +92,6 @@ func TestOracle(t *testing.T) { oracleErrCh <- err return } - if err := helpers.ExecOracleMsgAggregateVote(ctx, validator, "salt", "1.123uusd"); err != nil { - oracleErrCh <- err - return - } - if err := testutil.WaitForBlocks(ctx, 5, terra); err != nil { - oracleErrCh <- err - return - } } }(val) } @@ -109,13 +101,15 @@ func TestOracle(t *testing.T) { i := i go func() { defer wg.Done() - err := terra.SendFunds(ctx, users[i].KeyName(), ibc.WalletAmount{ - Address: users[0].FormattedAddress(), - Denom: terra.Config().Denom, - Amount: sdk.OneInt(), - }) - require.NoError(t, err) - require.NoError(t, testutil.WaitForBlocks(ctx, 1, terra)) + for j := 0; j < 5; j++ { + err := terra.SendFunds(ctx, users[i].KeyName(), ibc.WalletAmount{ + Address: users[0].FormattedAddress(), + Denom: terra.Config().Denom, + Amount: sdk.OneInt(), + }) + require.NoError(t, err) + require.NoError(t, testutil.WaitForBlocks(ctx, 1, terra)) + } }() } @@ -169,14 +163,14 @@ func TestOracle(t *testing.T) { require.NoError(t, err) } - // Verify final validator state - stdout, _, err := terra.Validators[0].ExecQuery(ctx, "staking", "validators") - require.NoError(t, err) - require.NotEmpty(t, stdout) + // // Verify final validator state + // stdout, _, err := terra.Validators[0].ExecQuery(ctx, "staking", "validators") + // require.NoError(t, err) + // require.NotEmpty(t, stdout) - terraValidators, _, err := helpers.UnmarshalValidators(*config.EncodingConfig, stdout) - require.NoError(t, err) - require.Equal(t, len(terraValidators), 3) + // terraValidators, _, err := helpers.UnmarshalValidators(*config.EncodingConfig, stdout) + // require.NoError(t, err) + // require.Equal(t, len(terraValidators), 3) } type Tx struct {