@@ -596,69 +596,3 @@ tape('Loading Legacy Versions', function (t) {
596
596
} ) ;
597
597
} ) ;
598
598
} ) ;
599
-
600
- tape ( 'Linking' , function ( t ) {
601
- // FIXME: all the linking tests require compileJSONMulti support,
602
- // create test cases which have all files in a single source and could run with 0.1.3
603
- if ( semver . lt ( solc . semver ( ) , '0.1.6' ) ) {
604
- t . skip ( 'Not supported by solc <0.1.6' ) ;
605
- t . end ( ) ;
606
- return ;
607
- }
608
-
609
- t . test ( 'link properly' , function ( st ) {
610
- /*
611
- 'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
612
- 'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
613
- */
614
- var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
615
- bytecode = linker . linkBytecode ( bytecode , { 'lib.sol:L' : '0x123456' } ) ;
616
- st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
617
- st . end ( ) ;
618
- } ) ;
619
-
620
- t . test ( 'link properly with two-level configuration (from standard JSON)' , function ( st ) {
621
- /*
622
- 'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
623
- 'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
624
- */
625
- var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
626
- bytecode = linker . linkBytecode ( bytecode , { 'lib.sol' : { 'L' : '0x123456' } } ) ;
627
- st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
628
- st . end ( ) ;
629
- } ) ;
630
-
631
- t . test ( 'linker to fail with missing library' , function ( st ) {
632
- /*
633
- 'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
634
- 'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
635
- */
636
- var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
637
- bytecode = linker . linkBytecode ( bytecode , { } ) ;
638
- st . ok ( bytecode . indexOf ( '_' ) >= 0 ) ;
639
- st . end ( ) ;
640
- } ) ;
641
-
642
- t . test ( 'linker to fail with invalid address' , function ( st ) {
643
- /*
644
- 'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
645
- 'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
646
- */
647
- var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
648
- st . throws ( function ( ) {
649
- linker . linkBytecode ( bytecode , { 'lib.sol:L' : '' } ) ;
650
- } ) ;
651
- st . end ( ) ;
652
- } ) ;
653
-
654
- t . test ( 'linker properly with truncated library name' , function ( st ) {
655
- /*
656
- 'lib.sol': 'library L1234567890123456789012345678901234567890 { function f() public returns (uint) { return 7; } }',
657
- 'cont.sol': 'import "lib.sol"; contract x { function g() public { L1234567890123456789012345678901234567890.f(); } }'
658
- */
659
- var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L123456789012345678901234567__6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a723058209f88ff686bd8ceb0fc08853dc1332d5ff81dbcf5af3a1e9aa366828091761f8c0029' ;
660
- bytecode = linker . linkBytecode ( bytecode , { 'lib.sol:L1234567890123456789012345678901234567890' : '0x123456' } ) ;
661
- st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
662
- st . end ( ) ;
663
- } ) ;
664
- } ) ;
0 commit comments