Skip to content

readonly callSC is not working #1373

Description

@veratek

The problem(s)
Calling purge from deweb SC fails when using station

To Reproduce

  async function handlePurge2() {
    setIsPurging(!isPurging);
    const callScParams:CallSCParams ={
      target: SC?.address || "",
      func: "purge",
      parameter: Uint8Array.from([]),
    }
    try {
     connectedAccount?.callSC(callScParams 
     ).then((res) => {
        res.waitFinalExecution().then((res) => {
          console.log("Final Execution", res)
        })
     })
    } catch (e) {
      console.error("Error while trying to read SC", e);
    }
  }

should see:
json: cannot unmarshal object into Go struct field LedgerUpdate.state_changes.ledger_changes.Update.bytecode of type string

Expected behavior(s)

Return Operation

Any other useful info
This may be happening only because we are changing the bytecode in the purge call
we need to change type string towards type bytes: pkg/node/sendoperation/interfaces.go line 115

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions