Skip to content

Commit

Permalink
test(pay-invoice): create mock invoices in the shared 'payInvoice.t.s…
Browse files Browse the repository at this point in the history
…ol' file
  • Loading branch information
gabrielstoica committed Jul 19, 2024
1 parent eefae04 commit ced9ee7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,6 @@ import { LockupLinear, LockupTranched } from "@sablier/v2-core/src/types/DataTyp
contract PayInvoice_Integration_Concret_Test is PayInvoice_Integration_Shared_Test {
function setUp() public virtual override {
PayInvoice_Integration_Shared_Test.setUp();

// Create a mock invoice with a one-off USDT transfer
Types.Invoice memory invoice = createInvoiceWithOneOffTransfer({ asset: address(usdt), recipient: users.eve });
invoices[0] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a one-off ETH transfer
invoice = createInvoiceWithOneOffTransfer({ asset: address(0), recipient: users.eve });
invoices[1] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a recurring USDT transfer
invoice = createInvoiceWithRecurringTransfer({ recurrence: Types.Recurrence.Weekly, recipient: users.eve });
invoices[2] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a linear stream payment
invoice = createInvoiceWithLinearStream({ recipient: users.eve });
invoices[3] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a tranched stream payment
invoice = createInvoiceWithTranchedStream({ recurrence: Types.Recurrence.Weekly, recipient: users.eve });
invoices[4] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });
}

function test_RevertWhen_InvoiceNull() external {
Expand Down
25 changes: 25 additions & 0 deletions test/integration/shared/payInvoice.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ abstract contract PayInvoice_Integration_Shared_Test is Integration_Test, Create

function setUp() public virtual override(Integration_Test, CreateInvoice_Integration_Shared_Test) {
CreateInvoice_Integration_Shared_Test.setUp();

// Create a mock invoice with a one-off USDT transfer
Types.Invoice memory invoice = createInvoiceWithOneOffTransfer({ asset: address(usdt), recipient: users.eve });
invoices[0] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a one-off ETH transfer
invoice = createInvoiceWithOneOffTransfer({ asset: address(0), recipient: users.eve });
invoices[1] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a recurring USDT transfer
invoice = createInvoiceWithRecurringTransfer({ recurrence: Types.Recurrence.Weekly, recipient: users.eve });
invoices[2] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a linear stream payment
invoice = createInvoiceWithLinearStream({ recipient: users.eve });
invoices[3] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });

// Create a mock invoice with a tranched stream payment
invoice = createInvoiceWithTranchedStream({ recurrence: Types.Recurrence.Weekly, recipient: users.eve });
invoices[4] = invoice;
executeCreateInvoice({ invoice: invoice, user: users.eve });
}

modifier whenInvoiceNotNull() {
Expand Down

0 comments on commit ced9ee7

Please sign in to comment.