dfinity / dfinity/pic-js

Using HttpAgent for sending request to PicJs Server

Open
#80 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10
Forks
13
Avg merge
4h 41m
Merged PRs (30d)
1

Description

I'm developing this standard ICRC-112.

I want to send a request from client to PicJS server when I run unit test

This is my code

const agent = await HttpAgent.create({ host: process.env.PIC_URL });

The error I got

 The canister call cannot be executed: AgentHTTPResponseError [AgentError]: Server returned an error:
        Code: 404 (Not Found)
        Body: 

The reason I ask this because I want to test making canister call as a signer to canister while testing

Signer have to send this kind of request to canister instead using actor

   {
          "canisterId": "eeddf-fqaaa-aaaao-a2hlq-ca",
          "method": "icrc2_approve",
          "arg": "RElETARte24AbAKzsNrDA2ithsqDBQFsA/vKAQKi3pTrBgHYo4yoDX0BAwEdV+ztKgq7E4l1ffuTuwEmw8AtYSjlrJ+WLO5ofQIAAMgB"
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the HttpAgent.create call using process.env.PIC_URL and the unit-test scenario described in the issue. Reproduce the 404 from the PicJS server, then compare the intended signer request with the shown canister-call JSON. Done means the request path and expected testing approach are established or the issue is documented as unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.