Skip to content

lecture 7 : unit testing #4590

Answered by pacelliv
haris4121 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @haris4121, that is possible because when you declare a variable as public, Solidity creates getter function for that variable.

It means this variable:

AggregatorV3Interface public PriceFeed;

Under the hood is equivalent to:

function getPriceFeed() public view returns (AggregatorV3Interface) {
      return PriceFeed;
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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
2 participants