-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add begin block deployments to mock mainnet #1189
Conversation
// setup uniswap v2 factory | ||
uniswapV2Factory, err := k.DeployUniswapV2Factory(ctx) | ||
if err != nil { | ||
return sdkerrors.Wrapf(err, "failed to DeployUniswapV2Factory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still sdkerrors
with errorsmod
some places
} | ||
_, err = k.SetupChainGasCoinAndPool(ctx, common.EthChain().ChainId, "ETH", "ETH", 18) | ||
if err != nil { | ||
return errorsmod.Wrapf(err, fmt.Sprintf("failed to setupChainGasCoinAndPool for %s", common.EthChain().ChainName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need fmt.Sprintf
since Wrapf
can already format strings
return sdkerrors.Wrapf(err, "failed to DeployUniswapV2Factory") | ||
} | ||
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent(sdk.EventTypeMessage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using sdk.EventTypeMessage
but this is not a message event
Same below
//err = k.SetGasPrice(ctx, big.NewInt(1337), big.NewInt(1)) | ||
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//err = k.SetGasPrice(ctx, big.NewInt(1337), big.NewInt(1)) | |
if err != nil { | |
return err | |
} |
We're handling the error but the method is commented out
) | ||
|
||
func (k Keeper) BlockOneDeploySystemContracts(_ context.Context) error { | ||
func (k Keeper) BlockOneDeploySystemContracts(goCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are code we could factorize with the other networks privnet, testnet.
I think we would benefit of having a single function BlockOneSetup
that group the setup operations logic common to all network and implement tests for this function since an error here or an inconsistency can prevent the network from working.
Could be another PR
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
…1259) * special handling to avoid duplicate payment on bitcoin outbound nonce 0 * use cctx amount instead of txResult's amount because it's not available in bitcoin mainnet --------- Co-authored-by: charliec <[email protected]>
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Closes:
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist: