Closed TimeKeyRoll closed 2 years ago
I understand what is a deployer
but what i don't understand is how its helping us in the function?
And same deployer
question about mentioned line.
it("adds funders to funder array", async function () {
await FundMe.fund({ value: sendValue })
const funder = await FundMe.getFunder(0)
assert.equal(funder, deployer)
i understand all the test
but does not get assert.equal(funder, deployer)
this line with deployer
how deployer
is helping us to test?
sorry for stupid questions. but need to know :)
We need to see that the person who originally sent ETH, in this case 'deployer' is actually pushed in the funders[] array.
FundMe.fund({value:sendValue})
is chained to the deployer account so the transaction is made with the deployer address and therefore the deployer address is pushed into the funders array. funder = await FundMe.getFunder(0)
is supposed to return the first entry in the funders[] and should return the expected address i.e the deployer's address.
And don't worry about the question being stupid or not :) You are doing good 👍🏽
Thank you very much.
Happy to help :) Close the issue If you think you got your answer, Cheers 😄
Hey @MasterofBlockchain the deployer in this statement
const response = await FundMe.getAddressToAMountFunder(deployer)
is the same deployer heredeployer = (await getNamedAccounts()).deployer
i.e. the account that deployed the FundMe contract when we linked them in this statementFundMe = await ethers.getContract("FundMe", deployer)
Originally posted by @othaime-en in https://github.com/smartcontractkit/full-blockchain-solidity-course-js/discussions/2049#discussioncomment-3474661