casper-ecosystem / casper-js-sdk

TypeScript Casper Client SDK
Apache License 2.0
71 stars 60 forks source link

Error loading transfer from JSON #357

Open meywood opened 11 months ago

meywood commented 11 months ago

TypeError: Cannot read properties of undefined (reading 'toBytes') The following exception is thrown when reading the attached JSON: transfer.json.txt

To Reproduce

        const buf  = fs.readFileSync(`./src/json//transfer.json.`);
        expect(buf).to.not.be.undefined;
        // JavaScript SDK requires deploy prefix to attempt to deseirialise 
        const parsedJson: any = { deploy: JSON.parse(buf.toString()) };
        const transfer : Deploy = this.casperClient.deployFromJson(parsedJson).unwrap();
        expect(transfer).to.not.be.null;
        this.contextMap.put("transfer", transfer);

Steps to reproduce the behavior:

  1. Go to '...'
  2. ..

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Defect Type