Skip to content

Commit

Permalink
WIP: solzrc20.withdraw works
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Jul 5, 2024
1 parent cd5a2ee commit b9b2598
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions e2e/txserver/zeta_tx_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ func (zts ZetaTxServer) DeploySystemContractsAndZRC20(
if err != nil {
return "", "", "", "", "", fmt.Errorf("failed to deploy btc zrc20: %s", err.Error())
}
_, err = zts.BroadcastTx(account, observertypes.NewMsgResetChainNonces(
addr.String(),
chains.SolanaLocalnet.ChainId,
0,
0,
))
if err != nil {
return "", "", "", "", "", fmt.Errorf("failed to reset chain nonces of solana: %s", err.Error())
}

// deploy erc20 zrc20
res, err = zts.BroadcastTx(account, fungibletypes.NewMsgDeployFungibleCoinZRC20(
Expand Down
4 changes: 4 additions & 0 deletions pkg/chains/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func (chain Chain) EncodeAddress(b []byte) (string, error) {
return "", fmt.Errorf("address is not for network %s", chainParams.Name)
}
return addrStr, nil
} else if chain.Consensus == Consensus_solana_consensus {
addrStr := string(b)
//FIXME: add validation here
return addrStr, nil
}
return "", fmt.Errorf("chain (%d) not supported", chain.ChainId)
}
Expand Down

0 comments on commit b9b2598

Please sign in to comment.