@@ -556,71 +556,56 @@ tape('Linking', function (t) {
556
556
}
557
557
558
558
t . test ( 'link properly' , function ( st ) {
559
- var input = {
559
+ /*
560
560
'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
561
561
'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
562
- } ;
563
- var output = solc . compile ( { sources : input } ) ;
564
- var bytecode = getBytecode ( output , 'cont.sol' , 'x' ) ;
565
- st . ok ( bytecode ) ;
566
- st . ok ( bytecode . length > 0 ) ;
562
+ */
563
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
567
564
bytecode = linker . linkBytecode ( bytecode , { 'lib.sol:L' : '0x123456' } ) ;
568
565
st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
569
566
st . end ( ) ;
570
567
} ) ;
571
568
572
569
t . test ( 'link properly with two-level configuration (from standard JSON)' , function ( st ) {
573
- var input = {
570
+ /*
574
571
'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
575
572
'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
576
- } ;
577
- var output = solc . compile ( { sources : input } ) ;
578
- var bytecode = getBytecode ( output , 'cont.sol' , 'x' ) ;
579
- st . ok ( bytecode ) ;
580
- st . ok ( bytecode . length > 0 ) ;
573
+ */
574
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
581
575
bytecode = linker . linkBytecode ( bytecode , { 'lib.sol' : { 'L' : '0x123456' } } ) ;
582
576
st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
583
577
st . end ( ) ;
584
578
} ) ;
585
579
586
580
t . test ( 'linker to fail with missing library' , function ( st ) {
587
- var input = {
581
+ /*
588
582
'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
589
583
'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
590
- } ;
591
- var output = solc . compile ( { sources : input } ) ;
592
- var bytecode = getBytecode ( output , 'cont.sol' , 'x' ) ;
593
- st . ok ( bytecode ) ;
594
- st . ok ( bytecode . length > 0 ) ;
584
+ */
585
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
595
586
bytecode = linker . linkBytecode ( bytecode , { } ) ;
596
587
st . ok ( bytecode . indexOf ( '_' ) >= 0 ) ;
597
588
st . end ( ) ;
598
589
} ) ;
599
590
600
591
t . test ( 'linker to fail with invalid address' , function ( st ) {
601
- var input = {
592
+ /*
602
593
'lib.sol': 'library L { function f() public returns (uint) { return 7; } }',
603
594
'cont.sol': 'import "lib.sol"; contract x { function g() public { L.f(); } }'
604
- } ;
605
- var output = solc . compile ( { sources : input } ) ;
606
- var bytecode = getBytecode ( output , 'cont.sol' , 'x' ) ;
607
- st . ok ( bytecode ) ;
608
- st . ok ( bytecode . length > 0 ) ;
595
+ */
596
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L_____________________________6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a72305820ea2f6353179c181d7162544d637b7fe2d9e8da9803a0e2d9eafc2188d1d59ee30029' ;
609
597
st . throws ( function ( ) {
610
598
linker . linkBytecode ( bytecode , { 'lib.sol:L' : '' } ) ;
611
599
} ) ;
612
600
st . end ( ) ;
613
601
} ) ;
614
602
615
603
t . test ( 'linker properly with truncated library name' , function ( st ) {
616
- var input = {
604
+ /*
617
605
'lib.sol': 'library L1234567890123456789012345678901234567890 { function f() public returns (uint) { return 7; } }',
618
606
'cont.sol': 'import "lib.sol"; contract x { function g() public { L1234567890123456789012345678901234567890.f(); } }'
619
- } ;
620
- var output = solc . compile ( { sources : input } ) ;
621
- var bytecode = getBytecode ( output , 'cont.sol' , 'x' ) ;
622
- st . ok ( bytecode ) ;
623
- st . ok ( bytecode . length > 0 ) ;
607
+ */
608
+ var bytecode = '608060405234801561001057600080fd5b5061011f806100206000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063e2179b8e146044575b600080fd5b348015604f57600080fd5b5060566058565b005b73__lib.sol:L123456789012345678901234567__6326121ff06040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801560b757600080fd5b505af415801560ca573d6000803e3d6000fd5b505050506040513d602081101560df57600080fd5b8101908080519060200190929190505050505600a165627a7a723058209f88ff686bd8ceb0fc08853dc1332d5ff81dbcf5af3a1e9aa366828091761f8c0029' ;
624
609
bytecode = linker . linkBytecode ( bytecode , { 'lib.sol:L1234567890123456789012345678901234567890' : '0x123456' } ) ;
625
610
st . ok ( bytecode . indexOf ( '_' ) < 0 ) ;
626
611
st . end ( ) ;
0 commit comments