Skip to content

Commit

Permalink
test(sdk): update OpenAllowList test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Sep 26, 2024
1 parent f11669c commit b811d0b
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/src/Actions/Action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function basicErc721TransferAction(

export function cloneEventAction(fixtures: Fixtures, erc721: MockERC721) {
return function cloneEventAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.EventAction(basicErc721TransferAction(erc721)),
);
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/src/Actions/ContractAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mintSelector = toFunctionSelector(

function payableContractAction(fixtures: Fixtures, erc20: MockERC20) {
return function payableContractAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.ContractAction({
chainId: BigInt(31_337),
Expand All @@ -50,7 +50,7 @@ function payableContractAction(fixtures: Fixtures, erc20: MockERC20) {

function nonPayableAction(fixtures: Fixtures, erc20: MockERC20) {
return function nonPayableAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.ContractAction({
chainId: BigInt(31_337),
Expand All @@ -64,7 +64,7 @@ function nonPayableAction(fixtures: Fixtures, erc20: MockERC20) {

function otherAction(fixtures: Fixtures, erc20: MockERC20) {
return function nonPayableAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.ContractAction({
chainId: BigInt(31_337) + 1n,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/Actions/ERC721MintAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mintSelector = toFunctionSelector('function mint(address to)');

function nonPayableAction(fixtures: Fixtures, erc721: MockERC721) {
return function nonPayableAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.ERC721MintAction({
chainId: BigInt(31_337),
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/Actions/EventAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function basicErc721MintFuncAction(

function cloneEventAction(fixtures: Fixtures, erc721: MockERC721) {
return function cloneEventAction() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.EventAction(basicErc721TransferAction(erc721)),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/AllowLists/AllowList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ beforeAll(async () => {

function freshAllowList(fixtures: Fixtures) {
return function freshAllowList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SimpleAllowList({
owner: defaultOptions.account.address,
Expand All @@ -31,7 +31,7 @@ function freshAllowList(fixtures: Fixtures) {

function freshDenyList(fixtures: Fixtures) {
return function freshDenyList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SimpleDenyList({
owner: defaultOptions.account.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/AllowLists/OpenAllowList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ beforeAll(async () => {

function freshOpenAllowList(fixtures: Fixtures) {
return function freshOpenAllowList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
new fixtures.bases.OpenAllowList(defaultOptions),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/AllowLists/SimpleAllowList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeAll(async () => {

function freshAllowList(fixtures: Fixtures) {
return function freshAllowList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SimpleAllowList({
owner: defaultOptions.account.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/AllowLists/SimpleDenyList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeAll(async () => {

function freshDenyList(fixtures: Fixtures) {
return function freshDenyList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SimpleDenyList({
owner: defaultOptions.account.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/Incentives/AllowListIncentive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let fixtures: Fixtures;

function freshAllowList(fixtures: Fixtures) {
return function freshAllowList() {
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SimpleAllowList({
owner: defaultOptions.account.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/Validators/SignerValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function freshValidator(fixtures: Fixtures) {
return function freshValidator() {
// biome-ignore lint/style/noNonNullAssertion: this will never be undefined
const account = accounts.at(1)!.account;
return fixtures.registry.clone(
return fixtures.registry.initialize(
crypto.randomUUID(),
fixtures.core.SignerValidator({
signers: [defaultOptions.account.address, account],
Expand Down
13 changes: 10 additions & 3 deletions packages/sdk/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ export async function deployFixtures(
isBase,
);
}
override OpenAllowList(isBase?: boolean) {
return new bases.OpenAllowList(
{ config: this._config, account: this._account },
undefined,
isBase,
);
}
SimpleBudget(options: DeployablePayloadOrAddress<SimpleBudgetPayload>) {
return new bases.SimpleBudget(
{ config: this._config, account: this._account },
Expand Down Expand Up @@ -481,7 +488,7 @@ export function freshBudget(
fixtures: Fixtures,
) {
return async function freshBudget() {
return await fixtures.registry.clone(
return await fixtures.registry.initialize(
crypto.randomUUID(),
new fixtures.bases.SimpleBudget(options, {
owner: options.account.address,
Expand All @@ -499,7 +506,7 @@ export function freshManagedBudget(
fixtures: Fixtures,
) {
return async function freshBudget() {
return await fixtures.registry.clone(
return await fixtures.registry.initialize(
crypto.randomUUID(),
new fixtures.bases.ManagedBudget(options, {
owner: options.account.address,
Expand All @@ -518,7 +525,7 @@ export function freshVestingBudget(
fixtures: Fixtures,
) {
return async function freshVestingBudget() {
return await fixtures.registry.clone(
return await fixtures.registry.initialize(
crypto.randomUUID(),
new fixtures.bases.VestingBudget(options, {
owner: options.account.address,
Expand Down

0 comments on commit b811d0b

Please sign in to comment.