-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package keeper | ||
|
||
import ( | ||
"errors" | ||
"math/big" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
ethcommon "github.com/ethereum/go-ethereum/common" | ||
evmtypes "github.com/evmos/ethermint/x/evm/types" | ||
) | ||
|
||
// ProcessV2Deposit handles a deposit from an inbound tx with protocol version 2 | ||
// returns [txResponse, isContractCall, error] | ||
// isContractCall is true if the message is non empty | ||
func (k Keeper) ProcessV2Deposit( | ||
ctx sdk.Context, | ||
zrc20Addr ethcommon.Address, | ||
to ethcommon.Address, | ||
amount *big.Int, | ||
message []byte, | ||
) (*evmtypes.MsgEthereumTxResponse, bool, error) { | ||
if len(message) == 0 { | ||
// simple deposit | ||
res, err := k.DepositZRC20(ctx, zrc20Addr, to, amount) | ||
return res, false, err | ||
} else { | ||
return nil, true, errors.New("not implemented") | ||
} | ||
} |