generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: show nested interfaces work (#123)
- Loading branch information
Showing
6 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/contracts/passing_contracts/interfaces/nested/IFaceNested.vy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@view | ||
@external | ||
def read_stuff_nested() -> uint256: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
# @version ^0.3.3 | ||
|
||
# Import a local interface. | ||
implements: IFaceNested | ||
from .interfaces import IFace as IFace | ||
|
||
# Import from input JSON (ape-config.yaml). | ||
import exampledependency.Dependency as Dep | ||
|
||
from .interfaces import IFace2 as IFace2 | ||
|
||
# Also use IFaceNested to show we can use nested interfaces. | ||
from contracts.passing_contracts.interfaces.nested import IFaceNested as IFaceNested | ||
|
||
|
||
@external | ||
@view | ||
def read_contract(some_address: address) -> uint256: | ||
myContract: IFace = IFace(some_address) | ||
return myContract.read_stuff() | ||
|
||
@view | ||
@external | ||
def read_stuff_nested() -> uint256: | ||
return 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters