Skip to content

lecture 7 ,testing #4591

Answered by haris4121
haris4121 asked this question in Q&A
Jan 24, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

here is the snippet but but this issue is still unresolved due to recent update in hardhat , although i we have custom error like for withdraw fucntion .

error FundMe__NotOwner();

then we can use

await expect(
                fundMeConnectedContract.withdraw()
            ).to.be.revertedWithCustomError(
                fundMeConnectedContract,
                "FundMe__NotOwner"
            )

here is the snippet of fundme

// SPDX-License-Identifier: MIT
/* using nas stling guide*/
pragma solidity ^0.8.8;
import "./PriceConverter.sol";
error FundMe__NotOwner();

/**@title A contract for crowd funding
 * @author haris rashid
 * @notice this is demo for sample funding contract
 * @dev this…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@haris4121
Comment options

@rin-st
Comment options

@pacelliv
Comment options

Comment options

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

Answer selected by haris4121
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