Skip to content

Issue with writing test for hardhat-simplestorage #1432

Answered by technophile-04
deeptshukla asked this question in Q&A
Discussion options

You must be logged in to vote

Hii, The length of a public array is not exposed by default in solidity. You can add a function in your contract which returns the length of people array

function getNumberOfpeoples() public view returns(uint256){
   return people.length
}

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@deeptshukla
Comment options

@krakxn
Comment options

Comment options

You must be logged in to vote
1 reply
@technophile-04
Comment options

Answer selected by deeptshukla
Comment options

You must be logged in to vote
1 reply
@krakxn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants