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

Write unit tests for EVM order service #81

Open
chibie opened this issue Aug 22, 2023 · 3 comments
Open

Write unit tests for EVM order service #81

chibie opened this issue Aug 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@chibie
Copy link
Contributor

chibie commented Aug 22, 2023

User Story

As a developer, I want to write tests for the OrderService functions so that the core order management logic is thoroughly tested.

Acceptance Criteria

  1. GIVEN the CreateOrder method
    WHEN testing
    THEN validate it handles fetching order data, initializing user operation, creating calldata, sponsoring, signing, sending, and updating order status

  2. GIVEN the RefundOrder method
    WHEN testing
    THEN validate it handles fetching lock order data, initializing user operation, creating calldata, sponsoring, signing, sending, and updating order status

  3. GIVEN the RevertOrder method
    WHEN testing
    THEN validate it handles fetching order data, calculating revert amount, initializing user operation, creating calldata, sponsoring, signing, sending, and updating order

  4. GIVEN the SettleOrder method
    WHEN testing
    THEN validate it handles fetching lock order data, initializing user operation, creating calldata, sponsoring, signing, sending, and updating order

Product & Design Links

Tech Details

  • Mock out RPC client calls to the bundler and paymaster APIs

Open Questions

Notes/Assumptions

@chibie chibie added the sender label Aug 22, 2023
@chibie chibie added this to the [ALPHA] Implement Sender API milestone Sep 6, 2023
@chibie chibie added the MVP label Dec 2, 2023
@chibie chibie added enhancement New feature or request and removed protocol-team labels Jan 22, 2024
@chibie chibie changed the title Write tests for create order feature with smart accounts Write unit tests for order service Feb 7, 2024
@chibie chibie changed the title Write unit tests for order service Write unit tests for EVM order service Jun 24, 2024
@xlassix
Copy link

xlassix commented Jul 25, 2024

After carefully looking through the services and the nested loop of API call from

  • getNonce
  • GetPaymasterAccount
  • executeBatchTransferCallData
  • executeBatchCreateOrderCallData
  • eth_getUserOperationReceipt
  • pm_accounts

all has to be mocked with fuzzy reponses, unlike the userop_test for user_op which the RPC values returned are not been consumed. here in evm.go. "Everything is in use" and dependant on the next

@chibie chibie removed the MVP label Jan 20, 2025
@Supa-mega
Copy link

Can I take care of this issue?

@viktrified
Copy link

Can I jump on this task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants