@@ -102,9 +102,9 @@ function runTests (solc, versionText) {
102
102
return ;
103
103
}
104
104
105
- var output = JSON . parse ( solc . lowlevel . compileSingle ( 'contract x { function g() public {} }' ) ) ;
105
+ var output = JSON . parse ( solc . lowlevel . compileSingle ( 'contract A { function g() public {} }' ) ) ;
106
106
st . ok ( 'contracts' in output ) ;
107
- var bytecode = getBytecode ( output , '' , 'x ' ) ;
107
+ var bytecode = getBytecode ( output , '' , 'A ' ) ;
108
108
st . ok ( typeof bytecode === 'string' ) ;
109
109
st . ok ( bytecode . length > 0 ) ;
110
110
st . end ( ) ;
@@ -152,16 +152,16 @@ function runTests (solc, versionText) {
152
152
}
153
153
154
154
var input = {
155
- 'lib .sol' : 'library L { function f() public returns (uint) { return 7; } }' ,
156
- 'cont .sol' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
155
+ 'a .sol' : 'contract A { function f() public returns (uint) { return 7; } }' ,
156
+ 'b .sol' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
157
157
} ;
158
158
var output = JSON . parse ( solc . lowlevel . compileMulti ( JSON . stringify ( { sources : input } ) ) ) ;
159
- var x = getBytecode ( output , 'cont .sol' , 'x ' ) ;
160
- st . ok ( typeof x === 'string' ) ;
161
- st . ok ( x . length > 0 ) ;
162
- var L = getBytecode ( output , 'lib .sol' , 'L ' ) ;
163
- st . ok ( typeof L === 'string' ) ;
164
- st . ok ( L . length > 0 ) ;
159
+ var B = getBytecode ( output , 'b .sol' , 'B ' ) ;
160
+ st . ok ( typeof B === 'string' ) ;
161
+ st . ok ( B . length > 0 ) ;
162
+ var A = getBytecode ( output , 'a .sol' , 'A ' ) ;
163
+ st . ok ( typeof A === 'string' ) ;
164
+ st . ok ( A . length > 0 ) ;
165
165
st . end ( ) ;
166
166
} ) ;
167
167
@@ -174,22 +174,22 @@ function runTests (solc, versionText) {
174
174
}
175
175
176
176
var input = {
177
- 'cont .sol' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
177
+ 'b .sol' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
178
178
} ;
179
179
function findImports ( path ) {
180
- if ( path === 'lib .sol' ) {
181
- return { contents : 'library L { function f() public returns (uint) { return 7; } }' } ;
180
+ if ( path === 'a .sol' ) {
181
+ return { contents : 'contract A { function f() public returns (uint) { return 7; } }' } ;
182
182
} else {
183
183
return { error : 'File not found' } ;
184
184
}
185
185
}
186
186
var output = JSON . parse ( solc . lowlevel . compileCallback ( JSON . stringify ( { sources : input } ) , 0 , findImports ) ) ;
187
- var x = getBytecode ( output , 'cont .sol' , 'x ' ) ;
188
- var L = getBytecode ( output , 'lib.sol' , 'L ') ;
189
- st . ok ( typeof x === 'string' ) ;
190
- st . ok ( x . length > 0 ) ;
191
- st . ok ( typeof L === 'string' ) ;
192
- st . ok ( L . length > 0 ) ;
187
+ var B = getBytecode ( output , 'b .sol' , 'B ' ) ;
188
+ st . ok ( typeof B === 'string ') ;
189
+ st . ok ( B . length > 0 ) ;
190
+ var A = getBytecode ( output , 'a.sol' , 'A' ) ;
191
+ st . ok ( typeof A === 'string' ) ;
192
+ st . ok ( A . length > 0 ) ;
193
193
st . end ( ) ;
194
194
} ) ;
195
195
@@ -202,7 +202,7 @@ function runTests (solc, versionText) {
202
202
}
203
203
204
204
var input = {
205
- 'cont .sol' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
205
+ 'b .sol' : 'import "a .sol"; contract B { function g() public { f(); } }'
206
206
} ;
207
207
function findImports ( path ) {
208
208
return { error : 'File not found' } ;
@@ -232,7 +232,7 @@ function runTests (solc, versionText) {
232
232
}
233
233
234
234
var input = {
235
- 'cont .sol' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
235
+ 'b .sol' : 'import "a .sol"; contract B { function g() public { f(); } }'
236
236
} ;
237
237
function findImports ( path ) {
238
238
throw new Error ( 'Could not implement this interface properly...' ) ;
@@ -269,7 +269,7 @@ function runTests (solc, versionText) {
269
269
}
270
270
271
271
var input = {
272
- 'cont .sol' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
272
+ 'b .sol' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
273
273
} ;
274
274
var output = JSON . parse ( solc . lowlevel . compileCallback ( JSON . stringify ( { sources : input } ) ) ) ;
275
275
st . plan ( 3 ) ;
@@ -304,11 +304,11 @@ function runTests (solc, versionText) {
304
304
}
305
305
} ,
306
306
'sources' : {
307
- 'lib .sol' : {
308
- 'content' : 'library L { function f() public returns (uint) { return 7; } }'
307
+ 'a .sol' : {
308
+ 'content' : 'contract A { function f() public returns (uint) { return 7; } }'
309
309
} ,
310
- 'cont .sol' : {
311
- 'content' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
310
+ 'b .sol' : {
311
+ 'content' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
312
312
}
313
313
}
314
314
} ;
@@ -322,8 +322,8 @@ function runTests (solc, versionText) {
322
322
}
323
323
324
324
var output = JSON . parse ( solc . lowlevel . compileStandard ( JSON . stringify ( input ) ) ) ;
325
- st . ok ( bytecodeExists ( output , 'cont .sol' , 'x ' ) ) ;
326
- st . ok ( bytecodeExists ( output , 'lib .sol' , 'L ' ) ) ;
325
+ st . ok ( bytecodeExists ( output , 'a .sol' , 'A ' ) ) ;
326
+ st . ok ( bytecodeExists ( output , 'b .sol' , 'B ' ) ) ;
327
327
st . end ( ) ;
328
328
} ) ;
329
329
@@ -379,15 +379,15 @@ function runTests (solc, versionText) {
379
379
}
380
380
} ,
381
381
'sources' : {
382
- 'cont .sol' : {
383
- 'content' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
382
+ 'b .sol' : {
383
+ 'content' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
384
384
}
385
385
}
386
386
} ;
387
387
388
388
function findImports ( path ) {
389
- if ( path === 'lib .sol' ) {
390
- return { contents : 'library L { function f() public returns (uint) { return 7; } }' } ;
389
+ if ( path === 'a .sol' ) {
390
+ return { contents : 'contract A { function f() public returns (uint) { return 7; } }' } ;
391
391
} else {
392
392
return { error : 'File not found' } ;
393
393
}
@@ -402,8 +402,8 @@ function runTests (solc, versionText) {
402
402
}
403
403
404
404
var output = JSON . parse ( solc . lowlevel . compileStandard ( JSON . stringify ( input ) , findImports ) ) ;
405
- st . ok ( bytecodeExists ( output , 'cont .sol' , 'x ' ) ) ;
406
- st . ok ( bytecodeExists ( output , 'lib .sol' , 'L ' ) ) ;
405
+ st . ok ( bytecodeExists ( output , 'a .sol' , 'A ' ) ) ;
406
+ st . ok ( bytecodeExists ( output , 'b .sol' , 'B ' ) ) ;
407
407
st . end ( ) ;
408
408
} ) ;
409
409
@@ -425,31 +425,31 @@ function runTests (solc, versionText) {
425
425
}
426
426
} ,
427
427
'sources' : {
428
- 'lib .sol' : {
429
- 'content' : 'library L { function f() public returns (uint) { return 7; } }'
428
+ 'a .sol' : {
429
+ 'content' : 'contract A { function f() public returns (uint) { return 7; } }'
430
430
} ,
431
- 'cont .sol' : {
432
- 'content' : 'import "lib .sol"; contract x { function g() public { L. f(); } function h() internal {} }'
431
+ 'b .sol' : {
432
+ 'content' : 'import "a .sol"; contract B is A { function g() public { f(); } function h() internal {} }'
433
433
}
434
434
}
435
435
} ;
436
436
437
437
var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) ) ) ;
438
438
st . ok ( expectNoError ( output ) ) ;
439
- var x = getBytecodeStandard ( output , 'cont .sol' , 'x ' ) ;
440
- st . ok ( typeof x === 'string' ) ;
441
- st . ok ( x . length > 0 ) ;
442
- var xGas = getGasEstimate ( output , 'cont .sol' , 'x ' ) ;
443
- st . ok ( typeof xGas === 'object' ) ;
444
- st . ok ( typeof xGas [ 'creation' ] === 'object' ) ;
445
- st . ok ( typeof xGas [ 'creation' ] [ 'codeDepositCost' ] === 'string' ) ;
446
- st . ok ( typeof xGas [ 'external' ] === 'object' ) ;
447
- st . ok ( typeof xGas [ 'external' ] [ 'g()' ] === 'string' ) ;
448
- st . ok ( typeof xGas [ 'internal' ] === 'object' ) ;
449
- st . ok ( typeof xGas [ 'internal' ] [ 'h()' ] === 'string' ) ;
450
- var L = getBytecodeStandard ( output , 'lib .sol' , 'L ' ) ;
451
- st . ok ( typeof L === 'string' ) ;
452
- st . ok ( L . length > 0 ) ;
439
+ var B = getBytecodeStandard ( output , 'b .sol' , 'B ' ) ;
440
+ st . ok ( typeof B === 'string' ) ;
441
+ st . ok ( B . length > 0 ) ;
442
+ var BGas = getGasEstimate ( output , 'b .sol' , 'B ' ) ;
443
+ st . ok ( typeof BGas === 'object' ) ;
444
+ st . ok ( typeof BGas [ 'creation' ] === 'object' ) ;
445
+ st . ok ( typeof BGas [ 'creation' ] [ 'codeDepositCost' ] === 'string' ) ;
446
+ st . ok ( typeof BGas [ 'external' ] === 'object' ) ;
447
+ st . ok ( typeof BGas [ 'external' ] [ 'g()' ] === 'string' ) ;
448
+ st . ok ( typeof BGas [ 'internal' ] === 'object' ) ;
449
+ st . ok ( typeof BGas [ 'internal' ] [ 'h()' ] === 'string' ) ;
450
+ var A = getBytecodeStandard ( output , 'a .sol' , 'A ' ) ;
451
+ st . ok ( typeof A === 'string' ) ;
452
+ st . ok ( A . length > 0 ) ;
453
453
st . end ( ) ;
454
454
} ) ;
455
455
@@ -471,28 +471,28 @@ function runTests (solc, versionText) {
471
471
}
472
472
} ,
473
473
'sources' : {
474
- 'cont .sol' : {
475
- 'content' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
474
+ 'b .sol' : {
475
+ 'content' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
476
476
}
477
477
}
478
478
} ;
479
479
480
480
function findImports ( path ) {
481
- if ( path === 'lib .sol' ) {
482
- return { contents : 'library L { function f() public returns (uint) { return 7; } }' } ;
481
+ if ( path === 'a .sol' ) {
482
+ return { contents : 'contract A { function f() public returns (uint) { return 7; } }' } ;
483
483
} else {
484
484
return { error : 'File not found' } ;
485
485
}
486
486
}
487
487
488
488
var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) , findImports ) ) ;
489
489
st . ok ( expectNoError ( output ) ) ;
490
- var x = getBytecodeStandard ( output , 'cont .sol' , 'x ' ) ;
491
- st . ok ( typeof x === 'string' ) ;
492
- st . ok ( x . length > 0 ) ;
493
- var L = getBytecodeStandard ( output , 'lib .sol' , 'L ' ) ;
494
- st . ok ( typeof L === 'string' ) ;
495
- st . ok ( L . length > 0 ) ;
490
+ var A = getBytecodeStandard ( output , 'a .sol' , 'A ' ) ;
491
+ st . ok ( typeof A === 'string' ) ;
492
+ st . ok ( A . length > 0 ) ;
493
+ var B = getBytecodeStandard ( output , 'b .sol' , 'B ' ) ;
494
+ st . ok ( typeof B === 'string' ) ;
495
+ st . ok ( B . length > 0 ) ;
496
496
st . end ( ) ;
497
497
} ) ;
498
498
@@ -514,28 +514,28 @@ function runTests (solc, versionText) {
514
514
}
515
515
} ,
516
516
'sources' : {
517
- 'cont .sol' : {
518
- 'content' : 'import "lib .sol"; contract x { function g() public { L. f(); } }'
517
+ 'b .sol' : {
518
+ 'content' : 'import "a .sol"; contract B is A { function g() public { f(); } }'
519
519
}
520
520
}
521
521
} ;
522
522
523
523
function findImports ( path ) {
524
- if ( path === 'lib .sol' ) {
525
- return { contents : 'library L { function f() public returns (uint) { return 7; } }' } ;
524
+ if ( path === 'a .sol' ) {
525
+ return { contents : 'contract A { function f() public returns (uint) { return 7; } }' } ;
526
526
} else {
527
527
return { error : 'File not found' } ;
528
528
}
529
529
}
530
530
531
531
var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) , { import : findImports } ) ) ;
532
532
st . ok ( expectNoError ( output ) ) ;
533
- var x = getBytecodeStandard ( output , 'cont .sol' , 'x ' ) ;
534
- st . ok ( typeof x === 'string' ) ;
535
- st . ok ( x . length > 0 ) ;
536
- var L = getBytecodeStandard ( output , 'lib .sol' , 'L ' ) ;
537
- st . ok ( typeof L === 'string' ) ;
538
- st . ok ( L . length > 0 ) ;
533
+ var A = getBytecodeStandard ( output , 'a .sol' , 'A ' ) ;
534
+ st . ok ( typeof A === 'string' ) ;
535
+ st . ok ( A . length > 0 ) ;
536
+ var B = getBytecodeStandard ( output , 'b .sol' , 'B ' ) ;
537
+ st . ok ( typeof B === 'string' ) ;
538
+ st . ok ( B . length > 0 ) ;
539
539
st . end ( ) ;
540
540
} ) ;
541
541
@@ -565,18 +565,18 @@ function runTests (solc, versionText) {
565
565
'lib.sol' : {
566
566
'content' : 'library L { function f() public returns (uint) { return 7; } }'
567
567
} ,
568
- 'cont .sol' : {
569
- 'content' : 'import "lib.sol"; contract x { function g() public { L.f(); } }'
568
+ 'a .sol' : {
569
+ 'content' : 'import "lib.sol"; contract A { function g() public { L.f(); } }'
570
570
}
571
571
}
572
572
} ;
573
573
574
574
var output = JSON . parse ( solc . compile ( JSON . stringify ( input ) ) ) ;
575
575
st . ok ( expectNoError ( output ) ) ;
576
- var x = getBytecodeStandard ( output , 'cont .sol' , 'x ' ) ;
577
- st . ok ( typeof x === 'string' ) ;
578
- st . ok ( x . length > 0 ) ;
579
- st . ok ( Object . keys ( linker . findLinkReferences ( x ) ) . length === 0 ) ;
576
+ var A = getBytecodeStandard ( output , 'a .sol' , 'A ' ) ;
577
+ st . ok ( typeof A === 'string' ) ;
578
+ st . ok ( A . length > 0 ) ;
579
+ st . ok ( Object . keys ( linker . findLinkReferences ( A ) ) . length === 0 ) ;
580
580
var L = getBytecodeStandard ( output , 'lib.sol' , 'L' ) ;
581
581
st . ok ( typeof L === 'string' ) ;
582
582
st . ok ( L . length > 0 ) ;
@@ -608,18 +608,18 @@ function runTests (solc, versionText) {
608
608
'lib.sol' : {
609
609
'content' : 'library L { function f() public returns (uint) { return 7; } }'
610
610
} ,
611
- 'cont .sol' : {
612
- 'content' : 'import "lib.sol"; contract x { function g() public { L.f(); } }'
611
+ 'a .sol' : {
612
+ 'content' : 'import "lib.sol"; contract A { function g() public { L.f(); } }'
613
613
}
614
614
}
615
615
} ;
616
616
617
617
var output = JSON . parse ( solc . lowlevel . compileStandard ( JSON . stringify ( input ) ) ) ;
618
618
st . ok ( expectNoError ( output ) ) ;
619
- var x = getBytecodeStandard ( output , 'cont .sol' , 'x ' ) ;
620
- st . ok ( typeof x === 'string' ) ;
621
- st . ok ( x . length > 0 ) ;
622
- st . ok ( Object . keys ( linker . findLinkReferences ( x ) ) . length === 0 ) ;
619
+ var A = getBytecodeStandard ( output , 'a .sol' , 'A ' ) ;
620
+ st . ok ( typeof A === 'string' ) ;
621
+ st . ok ( A . length > 0 ) ;
622
+ st . ok ( Object . keys ( linker . findLinkReferences ( A ) ) . length === 0 ) ;
623
623
var L = getBytecodeStandard ( output , 'lib.sol' , 'L' ) ;
624
624
st . ok ( typeof L === 'string' ) ;
625
625
st . ok ( L . length > 0 ) ;
0 commit comments