Skip to content

Commit

Permalink
Test unexistent allowance
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed May 5, 2023
1 parent a5a814c commit 7a73167
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/evm/test/Allowance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,39 @@ import {
} from "./operators/setup";

describe("Allowance", async () => {
it.only("Unexistent allowance produces error", async () => {
const { roles, scopeFunction, invoke } = await loadFixture(
setupTwoParamsStatic
);

const allowanceKey =
"0x123000000000000000000000000000000000000000000000000000000000000f";

await scopeFunction([
{
parent: 0,
paramType: ParameterType.AbiEncoded,
operator: Operator.Matches,
compValue: "0x",
},
{
parent: 0,
paramType: ParameterType.Static,
operator: Operator.WithinAllowance,
compValue: allowanceKey,
},
{
parent: 0,
paramType: ParameterType.Static,
operator: Operator.Pass,
compValue: "0x",
},
]);

await expect(invoke(100, 100))
.to.be.revertedWithCustomError(roles, "ConditionViolation")
.withArgs(PermissionCheckerStatus.AllowanceExceeded, allowanceKey);
});
it("consumption in truthy And branch bleeds to other branches", async () => {
const { roles, scopeFunction, invoke, owner } = await loadFixture(
setupTwoParamsStatic
Expand Down

0 comments on commit 7a73167

Please sign in to comment.