Skip to content
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

test: initialize liquidity cap for newly deployed erc20 in WhiteListERC20 e2e test #2891

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e/e2etests/test_whitelist_erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func TestWhitelistERC20(r *runner.E2ERunner, _ []string) {
erc20zrc20Addr, err := txserver.FetchAttributeFromTxResponse(res, "zrc20_address")
require.NoError(r, err)

err = r.ZetaTxServer.InitializeLiquidityCap(erc20zrc20Addr)
require.NoError(r, err)

// ensure CCTX created
resCCTX, err := r.CctxClient.Cctx(r.Ctx, &crosschaintypes.QueryGetCctxRequest{Index: whitelistCCTXIndex})
require.NoError(r, err)
Expand Down
12 changes: 6 additions & 6 deletions e2e/txserver/zeta_tx_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func (zts ZetaTxServer) DeployZRC20s(
if err != nil {
return "", err
}
if err := zts.initializeLiquidityCap(zrc20); err != nil {
if err := zts.InitializeLiquidityCap(zrc20); err != nil {
return "", err
}

Expand All @@ -481,7 +481,7 @@ func (zts ZetaTxServer) DeployZRC20s(
if err != nil {
return "", err
}
if err := zts.initializeLiquidityCap(zrc20); err != nil {
if err := zts.InitializeLiquidityCap(zrc20); err != nil {
return "", err
}

Expand All @@ -503,7 +503,7 @@ func (zts ZetaTxServer) DeployZRC20s(
if err != nil {
return "", err
}
if err := zts.initializeLiquidityCap(zrc20); err != nil {
if err := zts.InitializeLiquidityCap(zrc20); err != nil {
return "", err
}

Expand All @@ -527,7 +527,7 @@ func (zts ZetaTxServer) DeployZRC20s(
if err != nil {
return "", err
}
if err := zts.initializeLiquidityCap(erc20zrc20Addr); err != nil {
if err := zts.InitializeLiquidityCap(erc20zrc20Addr); err != nil {
return "", err
}

Expand Down Expand Up @@ -579,8 +579,8 @@ func (zts *ZetaTxServer) SetAuthorityClient(authorityClient authoritytypes.Query
zts.authorityClient = authorityClient
}

// initializeLiquidityCap initializes the liquidity cap for the given coin with a large value
func (zts ZetaTxServer) initializeLiquidityCap(zrc20 string) error {
// InitializeLiquidityCap initializes the liquidity cap for the given coin with a large value
func (zts ZetaTxServer) InitializeLiquidityCap(zrc20 string) error {
liquidityCap := sdktypes.NewUint(1e18).MulUint64(1e12)

msg := fungibletypes.NewMsgUpdateZRC20LiquidityCap(
Expand Down
Loading