File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,15 @@ class ContractsManager {
137137 for ( className in self . contracts ) {
138138 contract = self . contracts [ className ] ;
139139
140- if ( contract . args === [ ] ) continue ;
140+ // look in code for dependencies
141+ let libMatches = ( contract . code . match ( / \: ( .* ?) (? = _ ) / g) || [ ] ) ;
142+ for ( let match of libMatches ) {
143+ self . contractDependencies [ className ] = self . contractDependencies [ className ] || [ ] ;
144+ self . contractDependencies [ className ] . push ( match . substr ( 1 ) ) ;
145+ }
141146
147+ // look in arguments for dependencies
148+ if ( contract . args === [ ] ) continue ;
142149 let ref = contract . args ;
143150 for ( let j = 0 ; j < ref . length ; j ++ ) {
144151 let arg = ref [ j ] ;
Original file line number Diff line number Diff line change 11pragma solidity ^ 0.4.11 ;
22
3- library AMyLib {
3+ library ZAMyLib {
44
55 function add (uint _a , uint _b ) returns (uint _c ) {
66 return _a + _b;
@@ -11,7 +11,7 @@ library AMyLib {
1111contract Test {
1212
1313 function testAdd () constant returns (uint _result ) {
14- return AMyLib .add (1 , 2 );
14+ return ZAMyLib .add (1 , 2 );
1515 }
1616
1717}
You can’t perform that action at this time.
0 commit comments