@ -56,22 +56,21 @@ tape('ContractParameters - (TxFormat.buildData) - link Libraries', function (t)
function testLinkLibrary ( st , fakeDeployedContracts ) {
function testLinkLibrary ( st , fakeDeployedContracts ) {
var deployMsg = [ 'creation of library test.sol:lib1 pending...' ,
var deployMsg = [ 'creation of library test.sol:lib1 pending...' ,
'creation of library test.sol:lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2 pending...' ]
'creation of library test.sol:lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2 pending...' ]
txFormat . buildData ( 'testContractLinkLibrary' , context . contract , context . output . contracts , true , context . contract . abi [ 0 ] , '' , context . udapp
txFormat . buildData ( 'testContractLinkLibrary' , context . contract , context . output . contracts , true , context . contract . abi [ 0 ] , '' , ( error , data ) => {
, ( error , data ) => {
if ( error ) { return st . fails ( error ) }
if ( error ) { return st . fails ( error ) }
console . log ( data )
console . log ( data )
var linkedbyteCode = data . dataHex
var linkedbyteCode = data . dataHex
var libReference = context . contract . evm . bytecode . linkReferences [ 'test.sol' ] [ 'lib1' ]
var libReference = context . contract . evm . bytecode . linkReferences [ 'test.sol' ] [ 'lib1' ]
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 0 ] . start , 40 ) , fakeDeployedContracts [ 'lib1' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 0 ] . start , 40 ) , fakeDeployedContracts [ 'lib1' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 1 ] . start , 40 ) , fakeDeployedContracts [ 'lib1' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 1 ] . start , 40 ) , fakeDeployedContracts [ 'lib1' ] . replace ( '0x' , '' ) )
libReference = context . contract . evm . bytecode . linkReferences [ 'test.sol' ] [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ]
libReference = context . contract . evm . bytecode . linkReferences [ 'test.sol' ] [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ]
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 0 ] . start , 40 ) , fakeDeployedContracts [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 0 ] . start , 40 ) , fakeDeployedContracts [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 1 ] . start , 40 ) , fakeDeployedContracts [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ] . replace ( '0x' , '' ) )
st . equal ( linkedbyteCode . substr ( 2 * libReference [ 1 ] . start , 40 ) , fakeDeployedContracts [ 'lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2' ] . replace ( '0x' , '' ) )
} , ( msg ) => {
} , ( msg ) => {
st . equal ( msg , deployMsg [ 0 ] )
st . equal ( msg , deployMsg [ 0 ] )
deployMsg . shift ( )
deployMsg . shift ( )
} , ( ) => { } )
} , ( ) => { } )
}
}
var uintContract = ` contract uintContractTest {
var uintContract = ` contract uintContractTest {