@ -31,20 +31,20 @@ function runTests (browser) {
}
function testSimpleContract ( browser , callback ) {
contractHelper . testContracts ( browser , 'Untitled.sol' , sources [ 0 ] [ 'browser/Untitled.sol' ] , [ 'browser/Untitled.sol: TestContract' ] , function ( ) {
contractHelper . testContracts ( browser , 'Untitled.sol' , sources [ 0 ] [ 'browser/Untitled.sol' ] , [ 'TestContract' ] , function ( ) {
browser . click ( '.runView' )
. click ( '#runTabView div[class^="create"]' )
. pause ( 500 )
. testFunction ( 'f - transact (not payable)' ,
'0xa178c603400a184ce5fedbcfab392d9b77822f6ffa7facdec693aded214523bc' ,
'[vm] from:0xca3...a733c, to:browser/Untitled.sol: TestContract.f() 0x692...77b3a, value:0 wei, data:0x261...21ff0, 0 logs, hash:0xa17...523bc' , null ,
'[vm] from:0xca3...a733c, to:TestContract.f() 0x692...77b3a, value:0 wei, data:0x261...21ff0, 0 logs, hash:0xa17...523bc' , null ,
` {
"0" : "uint256: 8"
} ` )
. pause ( 500 )
. testFunction ( 'g - transact (not payable)' ,
'0xb1532162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92781' ,
'[vm] from:0xca3...a733c, to:browser/Untitled.sol: TestContract.g() 0x692...77b3a, value:0 wei, data:0xe21...79b8e, 0 logs, hash:0xb15...92781' , null , ` {
'[vm] from:0xca3...a733c, to:TestContract.g() 0x692...77b3a, value:0 wei, data:0xe21...79b8e, 0 logs, hash:0xb15...92781' , null , ` {
"0" : "uint256: 345" ,
"1" : "string: comment_comment_" ,
"2" : "bool: true" ,
@ -54,13 +54,13 @@ function testSimpleContract (browser, callback) {
}
function testReturnValues ( browser , callback ) {
contractHelper . testContracts ( browser , 'returnValues.sol' , sources [ 1 ] [ 'browser/returnValues.sol' ] , [ 'browser/returnValues.sol: testReturnValues' ] , function ( ) {
contractHelper . testContracts ( browser , 'returnValues.sol' , sources [ 1 ] [ 'browser/returnValues.sol' ] , [ 'testReturnValues' ] , function ( ) {
browser . click ( '.runView' )
. click ( '#runTabView div[class^="create"]' )
. pause ( 500 )
. testFunction ( 'retunValues1 - transact (not payable)' ,
'0x79dc928d149d2ade02ab610a8ae290636222d034d4adce0bb08a68401e3d1f7f' ,
'[vm] from:0xca3...a733c, to:browser/returnValues.sol: testReturnValues.retunValues1() 0x5e7...26e9f, value:0 wei, data:0x9ed...59eb7, 0 logs, hash:0x79d...d1f7f' ,
'[vm] from:0xca3...a733c, to:testReturnValues.retunValues1() 0x5e7...26e9f, value:0 wei, data:0x9ed...59eb7, 0 logs, hash:0x79d...d1f7f' ,
null ,
` {
"0" : "bool: _b true" ,
@ -71,7 +71,7 @@ function testReturnValues (browser, callback) {
. pause ( 500 )
. testFunction ( 'retunValues2 - transact (not payable)' ,
'0x09175dcb30227b3af422d75786dbba3b0549985e5c7f59f86d12c7e1043ccb8c' ,
'[vm] from:0xca3...a733c, to:browser/returnValues.sol: testReturnValues.retunValues2() 0x5e7...26e9f, value:0 wei, data:0xf57...4036c, 0 logs, hash:0x091...ccb8c' , null , ` {
'[vm] from:0xca3...a733c, to:testReturnValues.retunValues2() 0x5e7...26e9f, value:0 wei, data:0xf57...4036c, 0 logs, hash:0x091...ccb8c' , null , ` {
"0" : "bytes1: _b 0x12" ,
"1" : "bytes2: _b2 0x1223" ,
"2" : "bytes3: _b3 0x000000" ,
@ -84,7 +84,7 @@ function testReturnValues (browser, callback) {
"9" : "bytes32: _b32 0x0000000000000000000000000000000000032523532532523532523532523532"
} ` ).pause(500).testFunction('retunValues3 - transact (not payable)',
'0x7faab07aeaafc8afe6bf283bb83be70c000dff381dec04e779354e354da14aff' ,
'[vm] from:0xca3...a733c, to:browser/returnValues.sol: testReturnValues.retunValues3() 0x5e7...26e9f, value:0 wei, data:0x033...e0a7d, 0 logs, hash:0x7fa...14aff' , null , ` {
'[vm] from:0xca3...a733c, to:testReturnValues.retunValues3() 0x5e7...26e9f, value:0 wei, data:0x033...e0a7d, 0 logs, hash:0x7fa...14aff' , null , ` {
"0" : "uint8: _en 2" ,
"1" : "int256[5][]: _a1 1,-45,-78,56,60, -1,42,334,-45455,-446, 1,10,-5435,45,-7"
} ` ).perform(() => { callback(null, browser) })
@ -92,13 +92,13 @@ function testReturnValues (browser, callback) {
}
function testInputValues ( browser , callback ) {
contractHelper . testContracts ( browser , 'inputValues.sol' , sources [ 2 ] [ 'browser/inputValues.sol' ] , [ 'browser/inputValues.sol: test' ] , function ( ) {
contractHelper . testContracts ( browser , 'inputValues.sol' , sources [ 2 ] [ 'browser/inputValues.sol' ] , [ 'test' ] , function ( ) {
browser . click ( '.runView' )
. click ( '#runTabView div[class^="create"]' )
. pause ( 500 )
. testFunction ( 'inputValue1 - transact (not payable)' ,
'0x917a873d27d105213eaf5461e14780387ccceb66fed574f8432d1963917832ae' ,
'[vm] from:0xca3...a733c, to:browser/inputValues.sol: test.inputValue1(uint256,int256,string) 0x8c1...401f5, value:0 wei, data:0xd69...00000, 0 logs, hash:0x917...832ae' ,
'[vm] from:0xca3...a733c, to:test.inputValue1(uint256,int256,string) 0x8c1...401f5, value:0 wei, data:0xd69...00000, 0 logs, hash:0x917...832ae' ,
{ types : 'uint256 _u, int256 _i, string _str' , values : '"2343242", "-4324324", "string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"' } ,
` {
"0" : "uint256: _uret 2343242" ,
@ -106,7 +106,7 @@ function testInputValues (browser, callback) {
"2" : "string: _strret string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"
} ` ).pause(500).testFunction('inputValue2 - transact (not payable)',
'0x487d09e244853bcb108b3a22cd6ee57b6431e50869619c9b918e9764fc16ef7f' ,
'[vm] from:0xca3...a733c, to:browser/inputValues.sol: test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5, value:0 wei, data:0x1b7...00000, 1 logs, hash:0x487...6ef7f' ,
'[vm] from:0xca3...a733c, to:test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5, value:0 wei, data:0x1b7...00000, 1 logs, hash:0x487...6ef7f' ,
{ types : 'uint256[3] _n, bytes8[4] _b8' , values : '[1,2,3], ["0x1234", "0x1234","0x1234","0x1234"]' } ,
` {
"0" : "uint256[3]: _nret 1, 2, 3" ,
@ -131,15 +131,15 @@ function testInputValues (browser, callback) {
// @TODO test: bytes8[3][] type as input
var sources = [
{ 'browser/Untitled.sol' : ` pragma solidity ^0.4.0;
{ 'browser/Untitled.sol' : { content : ` pragma solidity ^0.4.0;
contract TestContract { function f ( ) returns ( uint ) { return 8 ; }
function g ( ) returns ( uint , string , bool , uint ) {
uint payment = 345 ;
bool payed = true ;
string memory comment = "comment_comment_" ;
uint month = 4 ;
return ( payment , comment , payed , month ) ; } } ` },
{ 'browser/returnValues.sol' : ` pragma solidity ^0.4.0;
return ( payment , comment , payed , month ) ; } } ` }} ,
{ 'browser/returnValues.sol' : { content : ` pragma solidity ^0.4.0;
contract testReturnValues {
enum ActionChoices { GoLeft , GoRight , GoStraight , SitStill }
function retunValues1 ( ) returns ( bool _b , uint _u , int _i , address _a ) {
@ -169,8 +169,8 @@ var sources = [
a [ 2 ] = [ int ( 1 ) , 10 , - 5435 , 45 , - 7 ] ;
_a1 = a ;
}
} ` },
{ 'browser/inputValues.sol' : ` pragma solidity ^0.4.0;
} ` }} ,
{ 'browser/inputValues.sol' : { content : ` pragma solidity ^0.4.0;
contract test {
event event1 ( int _i , uint indexed _u , string indexed _str , bytes4 _b , string _notIndexed ) ;
function inputValue1 ( uint _u , int _i , string _str ) returns ( uint _uret , int _iret , string _strret ) {
@ -183,5 +183,5 @@ var sources = [
_b8ret = _b8 ;
event1 ( - 123 , 123 , "test" , 0x1234 , "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test " ) ;
}
} ` }
} ` }}
]