trufflesuite / drizzle

Reactive Ethereum dapp UI suite
905 stars 235 forks source link

vue-plugin not marshaling methodArgs #24

Closed cds-amal closed 4 years ago

cds-amal commented 4 years ago

When calling a constant/view function that takes arguments the vue-plugin does not marshal the methodArgs parameter through to drizzle.

Contract

pragma solidity >=0.4.21 <0.6.0;

contract SimpleStorage {
    uint public storedData;

    function set(uint x) public { storedData = x;  }

    function getValueWithOffset(uint offset)
      public view
      returns (uint)
    {
        return storedData - offset;
    }
}

Client Code

<template>
  <div>
    <drizzle-contract
      contractName="SimpleStorage"
      method="storedData"
      label="Value"
    />

    <drizzle-contract
      contractName="SimpleStorage"
      method="getValueWithOffset"
      :methodArgs="[5]"
      label="OffsetValue"
    />

  </div>
</template>

<script>

export default {
  name: 'SimpleStorage'
}
</script>

<style></style>
cds-amal commented 4 years ago

Works as expected with latest codebase.