Skip to content

I got problem with mock multiple requests #39

@zealgt

Description

@zealgt

From the example code below

const foo = async () => {
  const contract = new ethers.Contract('0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb', abi, provider);
  
  const name = await contract.name()
  const balance = await contract.balanceOf('0x5Af489c8786A018EC4814194dC8048be1007e390')
  
  return { name, balance }
}

I also mock like this, but it only work at first call

mock({
  blockchain: 'ethereum',
  request: {
    to: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
    api,
    method: 'name',
    return: 'DePay',
  },
})

mock({
  blockchain: 'ethereum',
  request: {
    to: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb',
    api,
    method: 'balanceOf',
    params: '0x5Af489c8786A018EC4814194dC8048be1007e390',
    return: '1000',
  },
})

Is it possible to mock request for two method call with same smart contract address at the same time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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