5
5
deployContract ,
6
6
resolveImports ,
7
7
getServiceAddress ,
8
+ getAccountAddress ,
8
9
} from "../../src"
9
- import { defaultsByName } from "../../src/file "
10
+ import { defaultsByName } from "../../src"
10
11
import { DEFAULT_TEST_TIMEOUT } from "../util/timeout.const"
11
12
import { fixShorthandImports } from "../../src/imports"
12
13
@@ -32,11 +33,13 @@ describe("import resolver", () => {
32
33
} )
33
34
34
35
test ( "use imports" , async ( ) => {
36
+ const Dynamic = await getAccountAddress ( "Dynamic" )
35
37
await deployContract ( { code : emptyContract ( "First" ) , name : "First" } )
36
38
await deployContract ( { code : emptyContract ( "Second" ) , name : "Second" } )
37
39
await deployContract ( { code : emptyContract ( "Third" ) , name : "Third" } )
38
40
await deployContract ( { code : emptyContract ( "A" ) , name : "A" } )
39
41
await deployContract ( { code : emptyContract ( "B" ) , name : "B" } )
42
+ await deployContract ( { code : emptyContract ( "Dynamo" ) , name : "Dynamo" , to : Dynamic } )
40
43
41
44
const code = `
42
45
import First from 0xFIRST
@@ -47,6 +50,10 @@ describe("import resolver", () => {
47
50
import FungibleToken from 0xFUNGIBLETOKEN
48
51
import FlowToken from 0xFLOWTOKEN
49
52
53
+ import Dynamo from "DYNAMIC"
54
+ import Direct from 0x0123456789012345
55
+ import FungibleToken from 0x0123456789012345
56
+
50
57
access(all) fun main(){}
51
58
`
52
59
@@ -64,5 +71,9 @@ describe("import resolver", () => {
64
71
expect ( B ) . toBe ( Registry )
65
72
expect ( FungibleToken ) . toBe ( defaultsByName . FungibleToken )
66
73
expect ( FlowToken ) . toBe ( defaultsByName . FlowToken )
74
+ const { Dynamo, Direct, } = addressMap
75
+ expect ( Dynamo ) . toBe ( Dynamic )
76
+ expect ( Direct ) . toBe ( '0x0123456789012345' )
77
+ expect ( FungibleToken ) . toBe ( '0x0123456789012345' )
67
78
} )
68
79
} )
0 commit comments