-
Notifications
You must be signed in to change notification settings - Fork 108
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
12 changed files
with
501 additions
and
9 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
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,27 @@ | ||
package e2etests | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/zeta-chain/zetacore/e2e/runner" | ||
"github.com/zeta-chain/zetacore/precompiles/regular" | ||
) | ||
|
||
func TestPrecompilesRegular(r *runner.E2ERunner, args []string) { | ||
require.Len(r, args, 0, "No arguments expected") | ||
|
||
dummyBech32Addr := "1h8duy2dltz9xz0qqhm5wvcnj02upy887fyn43u" | ||
|
||
// Call the Regular contract in the static precompile address. | ||
contract, err := regular.NewRegularCaller(regular.ContractAddress, r.EVMClient) | ||
require.NoError(r, err, "Failed to create Regular contract caller") | ||
|
||
addr, err := contract.Bech32ToHexAddr( | ||
nil, | ||
common.HexToAddress("0xB9Dbc229Bf588A613C00BEE8e662727AB8121cfE").String(), | ||
) | ||
require.NoError(r, err, "Failed to call Bech32ToHexAddr in Regular precompiled contract") | ||
|
||
require.Equal(r, dummyBech32Addr, addr.String(), "Expected address %s, got %s", dummyBech32Addr, addr.String()) | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
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
Oops, something went wrong.