You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, the API successfully creates a task and returns an ID ({"id": "10017"})
Test Details
test("should fail when create a wallet with owner address",async()=>{awaitexpect(client.createTask({address: ownerAddress,tokenContract: TOKEN_CONTRACT,oracleContract: ORACLE_CONTRACT,})).rejects.toThrow("invalid address");});
Test Trace
FAIL tests/createTask.test.ts
listTasks Tests
○ skipped should throw error when creating a task without authentication
Auth with Signature
✕ should fail when creating a task with owner address using signature (448 ms)
○ skipped should create a task when authenticated with signature
Auth with API key
○ skipped should create a task when authenticated with API key
○ skipped should fail when creating a task with owner address using API key
● listTasks Tests › Auth with Signature › should fail when creating a task with owner address using signature
expect(received).rejects.toThrow()
Received promise resolved instead of rejected
Resolved to value: {"id": "21014"}
64 |
65 | test("should fail when creating a task with owner address using signature", async () => {
> 66 | await expect(
| ^
67 | client.createTask({
68 | address: ownerAddress,
69 | tokenContract: TOKEN_CONTRACT,
at expect (node_modules/expect/build/index.js:113:15)
at Object.<anonymous> (tests/createTask.test.ts:66:19)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 4 skipped, 5 total
Snapshots: 0 total
Time: 1.537 s, estimated 3 s
Reproduction Steps
Run npx jest tests/createTask.test.ts -t "should fail when creating a task with owner address using signature"
Observe that creating a task with owner address succeeds instead of failing
Additional Context
This might indicate that the API's address validation is not properly checking whether the provided address is a smart wallet
The test name suggests we want to enforce using smart wallet addresses only
The text was updated successfully, but these errors were encountered:
chrisli30
changed the title
Test Failure: Creating Task with Owner Address Should Fail but Succeeds
Test Failure: should fail when creating a task with owner address using signature
Nov 1, 2024
Expected Behavior
Current Behavior
Test Details
Test Trace
Reproduction Steps
npx jest tests/createTask.test.ts -t "should fail when creating a task with owner address using signature"
Additional Context
The text was updated successfully, but these errors were encountered: