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

refactor(tests/e2e-evm): Restructure ABI tests for extensibility & reduce duplication #2031

Open
wants to merge 11 commits into
base: nd-implement-basic-precompile-calling
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor: Rename unused params in test cases
  • Loading branch information
drklee3 committed Oct 8, 2024
commit 7ec0ffe4171f598bf9caea3200adb7416a56ba84
40 changes: 20 additions & 20 deletions tests/e2e-evm/test/abi_basic.test.ts
Original file line number Diff line number Diff line change
@@ -506,7 +506,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with a non-matching function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -518,7 +518,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with a non-matching function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -531,7 +531,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with a non-matching function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -547,7 +547,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with a non-matching function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -564,7 +564,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with a non-matching function selector via static call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -580,7 +580,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with a non-matching function selector via static call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -597,7 +597,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with an invalid (short) function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -609,7 +609,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with an invalid (short) function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -622,7 +622,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with an invalid (short) function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -638,7 +638,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with an invalid (short) function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -655,7 +655,7 @@ describe("ABI_BasicTests", function () {

{
name: "can be called with an invalid (short) function selector via static call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction;
},
txParams: (ctx) => ({
@@ -671,7 +671,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not be called with an invalid (short) function selector via static call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !fallbackFunction;
},
txParams: (ctx) => ({
@@ -689,7 +689,7 @@ describe("ABI_BasicTests", function () {
// Fallback payable tests
{
name: "can receive value with a non-matching function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability === "payable";
},
txParams: (ctx) => ({
@@ -703,7 +703,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not receive value with a non-matching function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability !== "payable";
},
txParams: (ctx) => ({
@@ -718,7 +718,7 @@ describe("ABI_BasicTests", function () {

{
name: "can receive value with a non-matching function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability === "payable";
},
txParams: (ctx) => ({
@@ -736,7 +736,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not receive value with a non-matching function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability !== "payable";
},
txParams: (ctx) => ({
@@ -755,7 +755,7 @@ describe("ABI_BasicTests", function () {

{
name: "can receive value with an invalid (short) function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability === "payable";
},
txParams: (ctx) => ({
@@ -769,7 +769,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not receive value with an invalid (short) function selector",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability !== "payable";
},
txParams: (ctx) => ({
@@ -784,7 +784,7 @@ describe("ABI_BasicTests", function () {

{
name: "can receive value with an invalid (short) function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability === "payable";
},
txParams: (ctx) => ({
@@ -802,7 +802,7 @@ describe("ABI_BasicTests", function () {
},
{
name: "can not receive value with an invalid (short) function selector via message call",
shouldRun(receiveFunction, fallbackFunction) {
shouldRun(_, fallbackFunction) {
return !!fallbackFunction && fallbackFunction.stateMutability !== "payable";
},
txParams: (ctx) => ({