Skip to content

Commit e78e237

Browse files
test: add sources for future testing
1 parent 22b55c6 commit e78e237

File tree

8 files changed

+62
-0
lines changed

8 files changed

+62
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# pragma version >=0.4.0
2+
3+
from . import provider as prov
4+
5+
# This uses USED_CONSTANT through an aliased import
6+
aliased_value: uint256
7+
8+
@deploy
9+
def __init__():
10+
self.aliased_value = prov.USED_CONSTANT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import provider as prov
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# pragma version >=0.4.0
2+
3+
from . import provider
4+
5+
# This line uses the constant from the provider module.
6+
some_value: uint256
7+
8+
@deploy
9+
def __init__():
10+
self.some_value = provider.USED_CONSTANT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import provider
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import importer as imp
2+
3+
@deploy
4+
def __init__():
5+
print(imp.provider.NESTED_USED_CONSTANT)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import importer
2+
3+
@deploy
4+
def __init__():
5+
print(importer.provider.NESTED_ALIASED_USED_CONSTANT)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import aliased_importer as imp
2+
3+
@deploy
4+
def __init__():
5+
print(imp.prov.NESTED_DOUBLE_ALIASED_USED_CONSTANT)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# pragma version >=0.4.0
2+
3+
# This constant is used by consumer.vy, so it should NOT be flagged.
4+
USED_CONSTANT: constant(uint256) = 100
5+
6+
# This constant is used only within this file, so it should NOT be flagged.
7+
LOCALLY_USED_CONSTANT: constant(uint256) = 200
8+
9+
# This constant is never used anywhere, so it SHOULD be flagged.
10+
TRULY_UNUSED_CONSTANT: constant(uint256) = 300
11+
12+
# This constant is used but only through module1.module2.NESTED_USED_CONSTANT
13+
NESTED_USED_CONSTANT: constant(uint256) = 400
14+
15+
# This constant is used but only through alias1.module2.NESTED_USED_CONSTANT
16+
NESTED_ALIASED_USED_CONSTANT: constant(uint256) = 600
17+
18+
# This constant is used but only through alias1.alias2.NESTED_DOUBLE_ALIASED_USED_CONSTANT
19+
NESTED_DOUBLE_ALIASED_USED_CONSTANT: constant(uint256) = 500
20+
21+
my_var: uint256
22+
23+
@deploy
24+
def __init__():
25+
self.my_var = LOCALLY_USED_CONSTANT

0 commit comments

Comments
 (0)