Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error calling a contract method #45

Open
nicosampler opened this issue Oct 24, 2019 · 0 comments
Open

Error calling a contract method #45

nicosampler opened this issue Oct 24, 2019 · 0 comments

Comments

@nicosampler
Copy link

nicosampler commented Oct 24, 2019

I'm having this error:

Failed to parse the request body: No case matched:
  At /kind, unexpected string instead of endorsement
  At /kind, unexpected string instead of seed_nonce_revelation
  At /kind, unexpected string instead of double_endorsement_evidence
  At /kind, unexpected string instead of double_baking_evidence
  At /kind, unexpected string instead of activate_account
  At /kind, unexpected string instead of proposals
  At /kind, unexpected string instead of ballot
  At /kind, unexpected string instead of reveal
  Unhandled error (Invalid_argument "Z.of_substring_base: invalid digit")
  At /kind, unexpected string instead of origination
  At /kind, unexpected string instead of delegation

Trying to call a contract method:

function main(const action: entry_action; var finance_storage: finance_storage): (list(operation) * finance_storage) is
  block {
    skip
  } with case action of
    | Deposit(param) -> depositImp(finance_storage)
    | Withdraw(param) -> withdrawImp(finance_storage)
    end;  

compiled code

parameter (or (unit %deposit) (unit %withdraw)) ;

I'm making the call like so:

  const v3FullPoolAddress = "KT1EufKiVMbL6r4T2whQT88crUZJM7J3SW66";
  const bobKeys = {
    pk: "edpktvrjBvRB7zJGEQKBFpwGS2rb12VD4ibTv7Kqgv9yAi6ARW3vQy",
    sk: "edsk3k86EP8oqGfgpmVq5XPpjwJTb3ivmDUpZw12j13dvnqnU3PCnM",
    phk: "tz1P4iVZLrBEjqNKUDBe7bqV8CB2AQ51ZKf8"
  };

  eztz.contract
    .send(v3FullPoolAddress, bobKeys.phk, bobKeys, 100, "(Left Unit)", 0.5)
    .then(res => {
      console.log(`Deposit Call from bob ${JSON.stringify(res)}`);
    })
    .catch(console.log);

calling the contract using tezos-client works fine, any idea what can I be doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant