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

Task creation with owner address returns CANCELLED error instead of invalid address #16

Closed
chrisli30 opened this issue Nov 1, 2024 · 1 comment
Labels
P2 Priority 2 testing Test cases related issue

Comments

@chrisli30
Copy link
Member

Expected Behavior

  • The API should reject task creation when using an owner address instead of a smart wallet address
  • Should throw an "invalid address" error

Current Behavior

  • Instead of receiving an "invalid address" error, the API call is cancelled
  • Receiving error: "1 CANCELLED: Call cancelled"

Test Details

test("should fail when creating a task with owner address using API key", async () => {
  await expect(
    client.createTask({
      address: ownerAddress,
      tokenContract: TOKEN_CONTRACT,
      oracleContract: ORACLE_CONTRACT,
    })
  ).rejects.toThrow("invalid address");
});

Test Trace

 FAIL  tests/createTask.test.ts
  ● listTasks Tests › Auth with API key › should fail when creating a task with owner address using API key

    expect(received).rejects.toThrow(expected)

    Expected substring: "invalid address"
    Received message:   "1 CANCELLED: Call cancelled"

          4576 |   _callRPC(method, request) {
          4577 |     return new Promise((resolve, reject) => {
        > 4578 |       this.rpcClient[method].bind(this.rpcClient)(

Reproduction Steps

  1. Run npx jest -t "should fail when creating a task with owner address using API key"
  2. Observe that instead of receiving an "invalid address" error, the call is cancelled

Additional Context

  • The error occurs at the gRPC client layer rather than reaching the API validation
  • This might indicate an issue with error handling in the API key authentication flow
  • The test expects a validation error but receives a connection/cancellation error instead
@chrisli30 chrisli30 added P2 Priority 2 testing Test cases related issue labels Nov 1, 2024
@v9n
Copy link
Member

v9n commented Nov 21, 2024

Fixed in #30

@v9n v9n closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority 2 testing Test cases related issue
Projects
None yet
Development

No branches or pull requests

2 participants