lesson-9
testing` questions about callStatic
#2412
-
Here is the
` Patrick said 1- I need to know why does not we want to use if its a 2- And If |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
"AND how its is different/useful in this case other than the non-transaction case?" For the difference b/w the two part: as above, a transaction leads to a change in state, and we do not want that. As for the usefulness part: it is useful because we are essentially "simulating" here. As transactions (they lead to a state-change) are processed by the nodes, what |
Beta Was this translation helpful? Give feedback.
"I need to know why does not we want to use if its a public function and create a transaction? Why not we want a transaction for testing? and what happens when we create a transaction?" Creating a transaction leads to a change in state. We do not want the state to change for
checkUpkeep
(where we check for the validity of the values, we do not want them to change--we want them to remain as is). Hence, we do not want the transaction to execute."Where does this function is coming from?" It is included in Ethers.js, the library we are using for JavaScript.
"AND how its is different/useful in this case other than the non-transaction case?" For the difference b/w the two part: as above,…