Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeyTM committed Sep 20, 2023
1 parent afc1b70 commit 4a59576
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 21 deletions.
10 changes: 6 additions & 4 deletions packages/core/src/errors-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ export const ERRORS = {
},
OVERLOAD_NAME_REQUIRED: {
number: 710,
message:
"%eventOrFunction% '%name%' is overloaded in contract %contractName%. Please use one of these names instead: %normalizedNameList%",
message: `%eventOrFunction% '%name%' is overloaded in contract %contractName%. Please use one of these names instead:
%normalizedNameList%`,
},
INVALID_OVERLOAD_GIVEN: {
number: 711,
message:
"%eventOrFunction% '%name%' is not a valid overload of '%bareName%' in contract %contractName%. Please use one of these names instead: %normalizedNameList%",
message: `%eventOrFunction% '%name%' is not a valid overload of '%bareName%' in contract %contractName%. Please use one of these names instead:
%normalizedNameList%`,
},
EVENT_ARG_NOT_FOUND: {
number: 712,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ describe("call", () => {

await assert.isRejected(
validateNamedContractCall(future as any, setupMockArtifactResolver()),
/Function "test" not found in contract Another/
/Function 'test' not found in contract Another/
);
});

Expand Down
22 changes: 11 additions & 11 deletions packages/core/test/execution/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe("abi", () => {
const artifact = callEncodingFixtures.WithComplexArguments;
assert.throws(() => {
decodeArtifactFunctionCallResult(artifact, "nonExistent", "0x");
}, 'Function "nonExistent" not found in contract WithComplexArguments');
}, "Function 'nonExistent' not found in contract WithComplexArguments");
});

it("Should be able to decode a single successful result", () => {
Expand Down Expand Up @@ -373,7 +373,7 @@ describe("abi", () => {
const artifact = callEncodingFixtures.WithComplexArguments;
assert.throws(() => {
encodeArtifactFunctionCall(artifact, "nonExistent", []);
}, 'Function "nonExistent" not found in contract WithComplexArguments');
}, "Function 'nonExistent' not found in contract WithComplexArguments");
});

it("Should encode the arguments and return them", () => {
Expand Down Expand Up @@ -651,7 +651,7 @@ describe("abi", () => {
callEncodingFixtures.FunctionNameValidation,
"12"
),
`Invalid function name "12"`
`Invalid function name '12'`
);

assert.throws(
Expand All @@ -660,7 +660,7 @@ describe("abi", () => {
callEncodingFixtures.FunctionNameValidation,
"asd(123, asd"
),
`Invalid function name "asd(123, asd"`
`Invalid function name 'asd(123, asd'`
);
});

Expand All @@ -671,7 +671,7 @@ describe("abi", () => {
callEncodingFixtures.FunctionNameValidation,
"nonExistentFunction"
),
`Function "nonExistentFunction" not found in contract FunctionNameValidation`
`Function 'nonExistentFunction' not found in contract FunctionNameValidation`
);

assert.throws(
Expand All @@ -680,7 +680,7 @@ describe("abi", () => {
callEncodingFixtures.FunctionNameValidation,
"nonExistentFunction2(uint,bytes32)"
),
`Function "nonExistentFunction2(uint,bytes32)" not found in contract FunctionNameValidation`
`Function 'nonExistentFunction2(uint,bytes32)' not found in contract FunctionNameValidation`
);
});

Expand Down Expand Up @@ -708,7 +708,7 @@ describe("abi", () => {
callEncodingFixtures.FunctionNameValidation,
"noOverloads()"
);
}, `Function name "noOverloads()" used for contract FunctionNameValidation, but it's not overloaded. Use "noOverloads" instead`);
}, `Function name 'noOverloads()' used for contract FunctionNameValidation, but it's not overloaded. Use 'noOverloads' instead`);
});
});

Expand All @@ -721,7 +721,7 @@ describe("abi", () => {
"withTypeBasedOverloads"
);
},
`Function "withTypeBasedOverloads" is overloaded in contract FunctionNameValidation. Please use one of these names instead:
`Function 'withTypeBasedOverloads' is overloaded in contract FunctionNameValidation. Please use one of these names instead:
* withTypeBasedOverloads(uint256)
* withTypeBasedOverloads(int256)`
Expand All @@ -734,7 +734,7 @@ describe("abi", () => {
"withParamCountOverloads"
);
},
`Function "withParamCountOverloads" is overloaded in contract FunctionNameValidation. Please use one of these names instead:
`Function 'withParamCountOverloads' is overloaded in contract FunctionNameValidation. Please use one of these names instead:
* withParamCountOverloads()
* withParamCountOverloads(int256)`
Expand All @@ -749,7 +749,7 @@ describe("abi", () => {
"withTypeBasedOverloads(bool)"
);
},
`Function "withTypeBasedOverloads(bool)" is not a valid overload of "withTypeBasedOverloads" in contract FunctionNameValidation. Please use one of these names instead:
`Function 'withTypeBasedOverloads(bool)' is not a valid overload of 'withTypeBasedOverloads' in contract FunctionNameValidation. Please use one of these names instead:
* withTypeBasedOverloads(uint256)
* withTypeBasedOverloads(int256)`
Expand All @@ -762,7 +762,7 @@ describe("abi", () => {
"withParamCountOverloads(bool)"
);
},
`Function "withParamCountOverloads(bool)" is not a valid overload of "withParamCountOverloads" in contract FunctionNameValidation. Please use one of these names instead:
`Function 'withParamCountOverloads(bool)' is not a valid overload of 'withParamCountOverloads' in contract FunctionNameValidation. Please use one of these names instead:
* withParamCountOverloads()
* withParamCountOverloads(int256)`
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/execution/libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("Libraries handling", () => {
"Lib",
"contracts/C.sol:Lib",
]);
}, `The names "contracts/C.sol:Lib" and "Lib" clash with each other`);
}, `The names 'contracts/C.sol:Lib' and 'Lib' clash with each other`);
});

it("Should accept bare names if non-ambiguous", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/readEventArgument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe("Read event argument", () => {

await assert.isRejected(
validateReadEventArgument(future as any, setupMockArtifactResolver()),
/Event "test" not found/
/Event 'test' not found/
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/staticCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ describe("static call", () => {

await assert.isRejected(
validateNamedStaticCall(future as any, setupMockArtifactResolver()),
/Function "test" not found in contract Another/
/Function 'test' not found in contract Another/
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/useModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe("useModule", () => {
type: DeploymentResultType.VALIDATION_ERROR,
errors: {
"Submodule1#Contract1": [
"Module parameter 'param1' requires a value but was given none",
"IGN725: Module parameter 'param1' requires a value but was given none",
],
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/wipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe("wipe", () => {

await assert.isRejected(
wiper.wipe(contract1Id),
`Cannot wipe ${contract1Id} as there are dependent futures that have already started:\n ${contract2Id}`
`Cannot wipe ${contract1Id} as there are dependent futures that have already started: ${contract2Id}`
);
});
});

0 comments on commit 4a59576

Please sign in to comment.