testing solidity - Error: invalid BigNumber value, when passing object as argument

301 views Asked by At

I have a function in my Solidity which takes a struct as first parameter:

function mintGenesisAnimal(AnimalInfo memory _animalInfo, string memory _tokenUri) onlyOwner public {
    // ...
}

but when I'm trying to test this function with the code below:

const animalInfo = {
    raceName: 'Tiger',
}

await Animal.mintGenesisAnimal(animalInfo, 'https://google.com')

The test fails with a weird issue relative to "BigNumber": Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.0)

Why is a BigNumber reported when I'm trying to pass a struct (js object) as parameter ?

0

There are 0 answers