1

I am trying to call a smart contract via RPC, but keep getting this error:

"Failed to parse the request body: No case matched:\n At /kind, unexpected string instead of endorsement\n At /kind, unexpected string instead of seed_nonce_revelation\n At /kind, unexpected string instead of double_endorsement_evidence\n At /kind, unexpected string instead of double_baking_evidence\n At /kind, unexpected string instead of activate_account\n At /kind, unexpected string instead of proposals\n At /kind, unexpected string instead of ballot\n At /kind, unexpected string instead of reveal\n At /parameters, missing object field entrypoint\n At /kind, unexpected string instead of origination\n At /kind, unexpected string instead of delegation"

This is what I am sending:

{
  "branch": "BLJWtitW4vnxKaLSyVB4Naybp112MWc3hwifosU8FhzRAh6LcT8",
  "contents": [
    {
      "source": "tz1S8g2w1YCzFwueTNweWPnA852mgCeXpsEu",
      "public_key": "edpkuvD4ebMTaVm7qqKUrh8mJXZGe5TyJNjWNFpSwdM1dLPDsM3wV4",
      "storage_limit": "0000000",
      "gas_limit": "0010000",
      "fee": "0001272",
      "kind": "reveal",
      "counter": "663191"
    },
    {
      "amount": "0000000",
      "source": "tz1S8g2w1YCzFwueTNweWPnA852mgCeXpsEu",
      "destination": "KT1BgA1y2Epm3qDh1HDf2mzjaiAx5hrNngcE",
      "storage_limit": "0000257",
      "gas_limit": "0010100",
      "fee": "0001272",
      "kind": "transaction",
      "counter": "663192",
      "parameters": {
        "string": "votes"
      }
    }
  ]
}

The call is expecting an input of string, you can check out the contract at KT1BgA1y2Epm3qDh1HDf2mzjaiAx5hrNngcE on Zeronet.

Would you happen to know what parameters are wrong/missing or some reference that I can compare my call to?

Thanks in advance.

0

I originated a contract of type string in a sandbox, and called it thus:

tezos-client -l transfer 0 from bootstrap1 to test_contract -arg '"votes"' --burn-cap 1

note the -l argument, which will show the RPCs between node and client. Notably, you will see the following output:

>>>>9: http://localhost:18731/chains/main/blocks/head/helpers/scripts/run_operation
  { "operation":
      { "branch": "BLxEpb5UYQAALGNTP8XqwBJra1wxDyGV4yLPLqehpNUCXb7moJK",
        "contents":
          [ { "kind": "transaction",
              "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "0",
              "counter": "3", "gas_limit": "800000",
              "storage_limit": "60000", "amount": "0",
              "destination": "KT18ynDzyLb659V492GVQXP5ztfq2gXiUaBv",
              "parameters":
                { "entrypoint": "default", "value": { "string": "votes" } } } ],
        "signature":
          "edsigtXomBKi5CTRf5cjATJWSyaRvhfYNHqSUGrn4SdbYRcGwQrUGjzEfQDTuqHhuA8b2d8NarZjz8TRf65WkpQmo423BtomS8Q" },
    "chain_id": "NetXdQprcVkpaWU" }
<<<<9: 200 OK

My argument looks like this:

{ "entrypoint": "default", "value": { "string": "votes" } } }

which is different from yours.

| improve this answer | |
  • Thanks, that was it, now it works flawlessly :) – Marek Fořt Dec 20 '19 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.