File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change
1
+ var assert = require ( 'assert' ) ;
1
2
var keccak256 = require ( 'js-sha3' ) . keccak256 ;
2
3
3
4
function libraryHashPlaceholder ( input ) {
4
5
return '$' + keccak256 ( input ) . slice ( 0 , 34 ) + '$' ;
5
6
}
6
7
7
8
var linkBytecode = function ( bytecode , libraries ) {
9
+ assert ( typeof bytecode === 'string' ) ;
10
+ assert ( typeof libraries === 'object' ) ;
8
11
// NOTE: for backwards compatibility support old compiler which didn't use file names
9
12
var librariesComplete = { } ;
10
13
for ( var libraryName in libraries ) {
@@ -52,6 +55,7 @@ var linkBytecode = function (bytecode, libraries) {
52
55
} ;
53
56
54
57
var findLinkReferences = function ( bytecode ) {
58
+ assert ( typeof bytecode === 'string' ) ;
55
59
// find 40 bytes in the pattern of __...<36 digits>...__
56
60
// e.g. __Lib.sol:L_____________________________
57
61
var linkReferences = { } ;
You can’t perform that action at this time.
0 commit comments