Skip to content

Commit

Permalink
Addressing PR comment about error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dkneisly committed Jan 10, 2024
1 parent 7794343 commit afaec69
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions integration-tests/actions/vrfv2_actions/vrfv2_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"sync"
"time"

"cosmossdk.io/errors"
"github.com/ethereum/go-ethereum/common"
"github.com/rs/zerolog"

Expand Down Expand Up @@ -110,7 +109,7 @@ func DeployVRFV2WrapperConsumers(contractDeployer contracts.ContractDeployer, li
for i := 1; i <= consumerContractsAmount; i++ {
loadTestConsumer, err := contractDeployer.DeployVRFV2WrapperLoadTestConsumer(linkTokenAddress, vrfV2Wrapper.Address())
if err != nil {
return nil, errors.Wrap(err, ErrAdvancedConsumer)
return nil, fmt.Errorf("%s, err %w", ErrAdvancedConsumer, err)
}
consumers = append(consumers, loadTestConsumer)
}
Expand All @@ -127,11 +126,11 @@ func DeployVRFV2DirectFundingContracts(
) (*VRFV2WrapperContracts, error) {
vrfv2Wrapper, err := contractDeployer.DeployVRFV2Wrapper(linkTokenAddress, linkEthFeedAddress, coordinator.Address())
if err != nil {
return nil, errors.Wrap(err, ErrDeployWrapper)
return nil, fmt.Errorf("%s, err %w", ErrDeployWrapper, err)
}
err = chainClient.WaitForEvents()
if err != nil {
return nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}

consumers, err := DeployVRFV2WrapperConsumers(contractDeployer, linkTokenAddress, vrfv2Wrapper, consumerContractsAmount)
Expand All @@ -140,7 +139,7 @@ func DeployVRFV2DirectFundingContracts(
}
err = chainClient.WaitForEvents()
if err != nil {
return nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}
return &VRFV2WrapperContracts{vrfv2Wrapper, consumers}, nil
}
Expand Down Expand Up @@ -373,7 +372,7 @@ func SetupVRFV2WrapperEnvironment(
}
err = env.EVMClient.WaitForEvents()
if err != nil {
return nil, nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}

// Configure VRF v2 wrapper contract
Expand All @@ -389,7 +388,7 @@ func SetupVRFV2WrapperEnvironment(
}
err = env.EVMClient.WaitForEvents()
if err != nil {
return nil, nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}

// Fetch wrapper subscription ID
Expand All @@ -399,7 +398,7 @@ func SetupVRFV2WrapperEnvironment(
}
err = env.EVMClient.WaitForEvents()
if err != nil {
return nil, nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}

// Fund wrapper subscription
Expand All @@ -418,7 +417,7 @@ func SetupVRFV2WrapperEnvironment(
}
err = env.EVMClient.WaitForEvents()
if err != nil {
return nil, nil, errors.Wrap(err, ErrWaitTXsComplete)
return nil, nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
}

return wrapperContracts, &wrapperSubID, nil
Expand Down

0 comments on commit afaec69

Please sign in to comment.