Skip to content

Returning array of values #24

@Juan-cc

Description

@Juan-cc

Hi, I am trying to simulate a call to UniswapV2Router02.swapExactETHForTokens() (link)

That method returns a uint[], so I tried mocking that using: abi.rawEncode([ "uint[]" ], [ [1] ])

Here is the complete method mock definition:

await uniswapV2Router02.givenMethodReturn(
      uniswapEncorder.encodeRouterETHForTokens(),
      abi.rawEncode([ "uint[]" ], [ [1] ])
    );

Is it possible to encode an array of values?

Thanks!

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