Skip to content

Commit

Permalink
initialize liq cap for newly deployed erc20 (#2891)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD authored Sep 17, 2024
1 parent 77cf636 commit 28305be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
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

0 comments on commit 28305be

Please sign in to comment.