File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -155,4 +155,15 @@ tape('Linking', function (t) {
155
155
st . equal ( bytecode , '6060604052341561000000000000000000000000000000000000012345666606060606060' ) ;
156
156
st . end ( ) ;
157
157
} ) ;
158
+
159
+ t . test ( 'link properly when library doesn\'t have colon in name' , function ( st ) {
160
+ /*
161
+ 'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
162
+ 'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
163
+ */
164
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__libName_______________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
165
+ bytecode = linker . linkBytecode ( bytecode , { 'libName' : '0x123456' } ) ;
166
+ st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
167
+ st . end ( ) ;
168
+ } ) ;
158
169
} ) ;
You can’t perform that action at this time.
0 commit comments