@@ -49,8 +49,14 @@ test.serial('erc20 full', async t => {
49
49
await runTest ( c , t , opts ) ;
50
50
} ) ;
51
51
52
- test . serial ( 'erc721 basic' , async t => {
53
- const opts : GenericOptions = { kind : 'ERC721' , name : 'My Token' , symbol : 'MTK' } ;
52
+ test . serial ( 'erc20 uups, roles' , async t => {
53
+ const opts : GenericOptions = { kind : 'ERC20' , name : 'My Token' , symbol : 'MTK' , upgradeable : 'uups' , access : 'roles' } ;
54
+ const c = buildERC20 ( opts ) ;
55
+ await runTest ( c , t , opts ) ;
56
+ } ) ;
57
+
58
+ test . serial ( 'erc721 uups, ownable' , async t => {
59
+ const opts : GenericOptions = { kind : 'ERC721' , name : 'My Token' , symbol : 'MTK' , upgradeable : 'uups' , access : 'ownable' } ;
54
60
const c = buildERC721 ( opts ) ;
55
61
await runTest ( c , t , opts ) ;
56
62
} ) ;
@@ -61,12 +67,24 @@ test.serial('erc1155 basic', async t => {
61
67
await runTest ( c , t , opts ) ;
62
68
} ) ;
63
69
70
+ test . serial ( 'erc1155 transparent, ownable' , async t => {
71
+ const opts : GenericOptions = { kind : 'ERC1155' , name : 'My Token' , uri : 'https://myuri/{id}' , upgradeable : 'transparent' , access : 'ownable' } ;
72
+ const c = buildERC1155 ( opts ) ;
73
+ await runTest ( c , t , opts ) ;
74
+ } ) ;
75
+
64
76
test . serial ( 'custom basic' , async t => {
65
77
const opts : GenericOptions = { kind : 'Custom' , name : 'My Contract' } ;
66
78
const c = buildCustom ( opts ) ;
67
79
await runTest ( c , t , opts ) ;
68
80
} ) ;
69
81
82
+ test . serial ( 'custom transparent, managed' , async t => {
83
+ const opts : GenericOptions = { kind : 'Custom' , name : 'My Contract' , upgradeable : 'transparent' , access : 'managed' } ;
84
+ const c = buildCustom ( opts ) ;
85
+ await runTest ( c , t , opts ) ;
86
+ } ) ;
87
+
70
88
async function runTest ( c : Contract , t : ExecutionContext < Context > , opts : GenericOptions ) {
71
89
const zip = await zipFoundry ( c , opts ) ;
72
90
@@ -105,8 +123,8 @@ async function extractAndRunPackage(zip: JSZip, c: Contract, t: ExecutionContext
105
123
106
124
const setGitUser = 'git init && git config user.email "[email protected] " && git config user.name "Test"' ;
107
125
const setup = 'bash setup.sh' ;
108
- const test = 'forge test' ;
109
- const script = `forge script script/${ c . name } .s.sol` ;
126
+ const test = 'forge test' + ( c . upgradeable ? ' --force' : '' ) ;
127
+ const script = `forge script script/${ c . name } .s.sol` + ( c . upgradeable ? ' --force' : '' ) ;
110
128
111
129
const exec = ( cmd : string ) => util . promisify ( child . exec ) ( cmd , { env : { ...process . env , NO_COLOR : '' } } ) ;
112
130
0 commit comments