@ -507,23 +507,23 @@ BOOST_AUTO_TEST_CASE(small_signed_types)
BOOST_AUTO_TEST_CASE ( strings )
{
char const * sourceCode = " contract test { \n "
" function fixed() returns(string 32 ret) { \n "
" function fixed() returns(byte s32 ret) { \n "
" return \" abc \\ x00 \\ xff__ \" ; \n "
" } \n "
" function pipeThrough(string 2 small, bool one) returns(string 16 large, bool oneRet) { \n "
" function pipeThrough(byte s2 small, bool one) returns(byte s16 large, bool oneRet) { \n "
" oneRet = one; \n "
" large = small; \n "
" } \n "
" } \n " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " fixed() " ) = = encodeArgs ( string ( " abc \0 \xff __ " , 7 ) ) ) ;
BOOST_CHECK ( callContractFunction ( " pipeThrough(string 2,bool) " , string ( " \0 \x02 " , 2 ) , true ) = = encodeArgs ( string ( " \0 \ x2 " , 2 ) , true ) ) ;
BOOST_CHECK ( callContractFunction ( " pipeThrough(byte s2,bool) " , string ( " \0 \x02 " , 2 ) , true ) = = encodeArgs ( string ( " \0 \ x2 " , 2 ) , true ) ) ;
}
BOOST_AUTO_TEST_CASE ( empty_string_on_stack )
{
char const * sourceCode = " contract test { \n "
" function run(string 0 empty, uint8 inp) returns(uint16 a, string 0 b, string 4 c) { \n "
" function run(byte s0 empty, uint8 inp) returns(uint16 a, byte s0 b, byte s4 c) { \n "
" var x = \" abc \" ; \n "
" var y = \" \" ; \n "
" var z = inp; \n "
@ -531,7 +531,7 @@ BOOST_AUTO_TEST_CASE(empty_string_on_stack)
" } \n "
" } \n " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " run(string 0,uint8) " , string ( ) , byte ( 0x02 ) ) = = encodeArgs ( 0x2 , string ( " " ) , string ( " abc \0 " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " run(byte s0,uint8) " , string ( ) , byte ( 0x02 ) ) = = encodeArgs ( 0x2 , string ( " " ) , string ( " abc \0 " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( state_smoke_test )
@ -948,8 +948,8 @@ BOOST_AUTO_TEST_CASE(multiple_elementary_accessors)
{
char const * sourceCode = " contract test { \n "
" uint256 public data; \n "
" string 6 public name; \n "
" hash public a_hash; \n "
" byte s6 public name; \n "
" bytes32 public a_hash; \n "
" address public an_address; \n "
" function test() { \n "
" data = 8; \n "
@ -971,7 +971,7 @@ BOOST_AUTO_TEST_CASE(multiple_elementary_accessors)
BOOST_AUTO_TEST_CASE ( complex_accessors )
{
char const * sourceCode = " contract test { \n "
" mapping(uint256 => string 4) public to_string_map; \n "
" mapping(uint256 => byte s4) public to_string_map; \n "
" mapping(uint256 => bool) public to_bool_map; \n "
" mapping(uint256 => uint256) public to_uint_map; \n "
" mapping(uint256 => mapping(uint256 => uint256)) public to_multiple_map; \n "
@ -1076,96 +1076,96 @@ BOOST_AUTO_TEST_CASE(type_conversions_cleanup)
0x33 , 0x44 , 0x55 , 0x66 , 0x77 , 0x88 , 0x99 , 0x00 , 0x11 , 0x22 } ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_string_to_string )
BOOST_AUTO_TEST_CASE ( convert_fixed_bytes_to_fixed_bytes_smaller_size )
{
char const * sourceCode = R " (
contract Test {
function pipeTrough ( string 3 input ) returns ( string3 ret ) {
return string3 ( input ) ;
function pipeTrough ( byte s3 input ) returns ( bytes2 ret ) {
return bytes2 ( input ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " pipeTrough(string 3) " , " abc " ) = = encodeArgs ( " abc " ) ) ;
BOOST_CHECK ( callContractFunction ( " pipeTrough(byte s3) " , " abc " ) = = encodeArgs ( " ab " ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_hash_to_string _same_size )
BOOST_AUTO_TEST_CASE ( convert_uint_to_fixed_bytes _same_size )
{
char const * sourceCode = R " (
contract Test {
function hashToString ( hash h ) returns ( string 32 s ) {
return string 32 ( h ) ;
function uintToBytes ( uint256 h ) returns ( byte s32 s ) {
return byte s32( h ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
u256 a ( " 0x6162630000000000000000000000000000000000000000000000000000000000 " ) ;
BOOST_CHECK ( callContractFunction ( " hashToString(hash 256)" , a ) = = encodeArgs ( a ) ) ;
BOOST_CHECK ( callContractFunction ( " uintToBytes(uint 256)" , a ) = = encodeArgs ( a ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_hash_to_string _different_size )
BOOST_AUTO_TEST_CASE ( convert_uint_to_fixed_bytes _different_size )
{
char const * sourceCode = R " (
contract Test {
function hashToString ( hash 160 h ) returns ( string 20 s ) {
return string 20 ( h ) ;
function uintToBytes ( uint 160 h ) returns ( byte s20 s ) {
return byte s20( h ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " hashToString(hash 160)" , u160 ( " 0x6161626361626361626361616263616263616263 " ) ) = =
encodeArgs ( string ( " aabcabcabcaabcabcabc " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " uintToBytes(uint 160)" ,
u160 ( " 0x6161626361626361626361616263616263616263 " ) ) = = encodeArgs ( string ( " aabcabcabcaabcabcabc " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_string_to_hash _same_size )
BOOST_AUTO_TEST_CASE ( convert_fixed_bytes_to_uint _same_size )
{
char const * sourceCode = R " (
contract Test {
function stringToHash ( string 32 s ) returns ( hash h ) {
return hash ( s ) ;
function bytesToUint ( bytes 32 s ) returns ( uint256 h ) {
return uint ( s ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " stringToHash(string 32)" , string ( " abc2 " ) ) = =
encodeArgs ( u256 ( " 0x6162633200000000000000000000000000000000000000000000000000000000 " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " bytesToUint(bytes 32)" , string ( " abc2 " ) ) = =
encodeArgs ( u256 ( " 0x6162633200000000000000000000000000000000000000000000000000000000 " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_string_to_hash _different_size )
BOOST_AUTO_TEST_CASE ( convert_fixed_bytes_to_uint _different_size )
{
char const * sourceCode = R " (
contract Test {
function stringToHash ( string 20 s ) returns ( hash 160 h ) {
return hash 160( s ) ;
function bytesToUint ( bytes 20 s ) returns ( uint 160 h ) {
return uint 160( s ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " stringToHash(string 20)" , string ( " aabcabcabcaabcabcabc " ) ) = =
encodeArgs ( u160 ( " 0x6161626361626361626361616263616263616263 " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " bytesToUint(bytes 20)" , string ( " aabcabcabcaabcabcabc " ) ) = =
encodeArgs ( u160 ( " 0x6161626361626361626361616263616263616263 " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_string_to_hash _different_min_size )
BOOST_AUTO_TEST_CASE ( convert_fixed_bytes_to_uint _different_min_size )
{
char const * sourceCode = R " (
contract Test {
function stringToHash ( string 1 s ) returns ( hash 8 h ) {
return hash 8( s ) ;
function bytesToUint ( bytes 1 s ) returns ( uint 8 h ) {
return uint 8( s ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " stringToHash(string 1)" , string ( " a " ) ) = =
encodeArgs ( u256 ( " 0x61 " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " bytesToUint(bytes 1)" , string ( " a " ) ) = =
encodeArgs ( u256 ( " 0x61 " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( convert_hash_to_string _different_min_size )
BOOST_AUTO_TEST_CASE ( convert_uint_to_fixed_bytes _different_min_size )
{
char const * sourceCode = R " (
contract Test {
function HashToString ( hash 8 h ) returns ( string 1 s ) {
return string 1 ( h ) ;
function UintToBytes ( uint 8 h ) returns ( byte s1 s ) {
return byte s1( h ) ;
}
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_CHECK ( callContractFunction ( " HashToString(hash 8)" , u256 ( " 0x61 " ) ) = =
encodeArgs ( string ( " a " ) ) ) ;
BOOST_CHECK ( callContractFunction ( " UintToBytes(uint 8)" , u256 ( " 0x61 " ) ) = =
encodeArgs ( string ( " a " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( send_ether )
@ -1299,7 +1299,7 @@ BOOST_AUTO_TEST_CASE(suicide)
BOOST_AUTO_TEST_CASE ( sha3 )
{
char const * sourceCode = " contract test { \n "
" function a(hash input) returns (hash sha3hash) { \n "
" function a(bytes32 input) returns (bytes32 sha3hash) { \n "
" return sha3(input); \n "
" } \n "
" } \n " ;
@ -1308,15 +1308,15 @@ BOOST_AUTO_TEST_CASE(sha3)
{
return dev : : sha3 ( toBigEndian ( _x ) ) ;
} ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( - 1 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( - 1 ) ) ;
}
BOOST_AUTO_TEST_CASE ( sha256 )
{
char const * sourceCode = " contract test { \n "
" function a(hash input) returns (hash sha256hash) { \n "
" function a(bytes32 input) returns (bytes32 sha256hash) { \n "
" return sha256(input); \n "
" } \n "
" } \n " ;
@ -1327,15 +1327,15 @@ BOOST_AUTO_TEST_CASE(sha256)
dev : : sha256 ( dev : : ref ( toBigEndian ( _input ) ) , bytesRef ( & ret [ 0 ] , 32 ) ) ;
return ret ;
} ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( - 1 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( - 1 ) ) ;
}
BOOST_AUTO_TEST_CASE ( ripemd )
{
char const * sourceCode = " contract test { \n "
" function a(hash input) returns (hash sha256hash) { \n "
" function a(bytes32 input) returns (bytes32 sha256hash) { \n "
" return ripemd160(input); \n "
" } \n "
" } \n " ;
@ -1346,15 +1346,15 @@ BOOST_AUTO_TEST_CASE(ripemd)
dev : : ripemd160 ( dev : : ref ( toBigEndian ( _input ) ) , bytesRef ( & ret [ 0 ] , 32 ) ) ;
return u256 ( ret ) > > ( 256 - 160 ) ;
} ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(hash256 ) " , f , u256 ( - 1 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 4 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( 5 ) ) ;
testSolidityAgainstCpp ( " a(bytes32 ) " , f , u256 ( - 1 ) ) ;
}
BOOST_AUTO_TEST_CASE ( ecrecover )
{
char const * sourceCode = " contract test { \n "
" function a(hash h, uint8 v, hash r, hash s) returns (address addr) { \n "
" function a(bytes32 h, uint8 v, bytes32 r, bytes32 s) returns (address addr) { \n "
" return ecrecover(h, v, r, s); \n "
" } \n "
" } \n " ;
@ -1364,7 +1364,7 @@ BOOST_AUTO_TEST_CASE(ecrecover)
u256 r ( " 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f " ) ;
u256 s ( " 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549 " ) ;
u160 addr ( " 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b " ) ;
BOOST_CHECK ( callContractFunction ( " a(hash256,uint8,hash256,hash256 ) " , h , v , r , s ) = = encodeArgs ( addr ) ) ;
BOOST_CHECK ( callContractFunction ( " a(bytes32,uint8,bytes32,bytes32 ) " , h , v , r , s ) = = encodeArgs ( addr ) ) ;
}
BOOST_AUTO_TEST_CASE ( inter_contract_calls )
@ -1524,17 +1524,17 @@ BOOST_AUTO_TEST_CASE(inter_contract_calls_with_local_vars)
BOOST_REQUIRE ( callContractFunction ( " callHelper(uint256,uint256) " , a , b ) = = encodeArgs ( a * b + 9 ) ) ;
}
BOOST_AUTO_TEST_CASE ( string s_in_calls)
BOOST_AUTO_TEST_CASE ( fixed_byte s_in_calls)
{
char const * sourceCode = R " (
contract Helper {
function invoke ( string 3 x , bool stop ) returns ( string 4 ret ) {
function invoke ( byte s3 x , bool stop ) returns ( byte s4 ret ) {
return x ;
}
}
contract Main {
Helper h ;
function callHelper ( string 2 x , bool stop ) returns ( string 5 ret ) {
function callHelper ( byte s2 x , bool stop ) returns ( byte s5 ret ) {
return h . invoke ( x , stop ) ;
}
function getHelper ( ) returns ( address addr ) {
@ -1549,21 +1549,21 @@ BOOST_AUTO_TEST_CASE(strings_in_calls)
compileAndRun ( sourceCode , 0 , " Main " ) ;
BOOST_REQUIRE ( callContractFunction ( " setHelper(address) " , c_helperAddress ) = = bytes ( ) ) ;
BOOST_REQUIRE ( callContractFunction ( " getHelper() " , c_helperAddress ) = = encodeArgs ( c_helperAddress ) ) ;
BOOST_CHECK ( callContractFunction ( " callHelper(string 2,bool) " , string ( " \0 a " , 2 ) , true ) = = encodeArgs ( string ( " \0 a \0 \0 \0 " , 5 ) ) ) ;
BOOST_CHECK ( callContractFunction ( " callHelper(byte s2,bool) " , string ( " \0 a " , 2 ) , true ) = = encodeArgs ( string ( " \0 a \0 \0 \0 " , 5 ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( constructor_arguments )
{
char const * sourceCode = R " (
contract Helper {
string 3 name ;
byte s3 name ;
bool flag ;
function Helper ( string 3 x , bool f ) {
function Helper ( byte s3 x , bool f ) {
name = x ;
flag = f ;
}
function getName ( ) returns ( string 3 ret ) { return name ; }
function getName ( ) returns ( byte s3 ret ) { return name ; }
function getFlag ( ) returns ( bool ret ) { return flag ; }
}
contract Main {
@ -1572,7 +1572,7 @@ BOOST_AUTO_TEST_CASE(constructor_arguments)
h = new Helper ( " abc " , true ) ;
}
function getFlag ( ) returns ( bool ret ) { return h . getFlag ( ) ; }
function getName ( ) returns ( string 3 ret ) { return h . getName ( ) ; }
function getName ( ) returns ( byte s3 ret ) { return h . getName ( ) ; }
} ) " ;
compileAndRun ( sourceCode , 0 , " Main " ) ;
BOOST_REQUIRE ( callContractFunction ( " getFlag() " ) = = encodeArgs ( true ) ) ;
@ -1583,13 +1583,13 @@ BOOST_AUTO_TEST_CASE(functions_called_by_constructor)
{
char const * sourceCode = R " (
contract Test {
string 3 name ;
byte s3 name ;
bool flag ;
function Test ( ) {
setName ( " abc " ) ;
}
function getName ( ) returns ( string 3 ret ) { return name ; }
function setName ( string 3 _name ) private { name = _name ; }
function getName ( ) returns ( byte s3 ret ) { return name ; }
function setName ( byte s3 _name ) private { name = _name ; }
} ) " ;
compileAndRun ( sourceCode ) ;
BOOST_REQUIRE ( callContractFunction ( " getName() " ) = = encodeArgs ( " abc " ) ) ;
@ -1697,13 +1697,13 @@ BOOST_AUTO_TEST_CASE(value_for_constructor)
{
char const * sourceCode = R " (
contract Helper {
string 3 name ;
byte s3 name ;
bool flag ;
function Helper ( string 3 x , bool f ) {
function Helper ( byte s3 x , bool f ) {
name = x ;
flag = f ;
}
function getName ( ) returns ( string 3 ret ) { return name ; }
function getName ( ) returns ( byte s3 ret ) { return name ; }
function getFlag ( ) returns ( bool ret ) { return flag ; }
}
contract Main {
@ -1712,7 +1712,7 @@ BOOST_AUTO_TEST_CASE(value_for_constructor)
h = new Helper . value ( 10 ) ( " abc " , true ) ;
}
function getFlag ( ) returns ( bool ret ) { return h . getFlag ( ) ; }
function getName ( ) returns ( string 3 ret ) { return h . getName ( ) ; }
function getName ( ) returns ( byte s3 ret ) { return h . getName ( ) ; }
function getBalances ( ) returns ( uint me , uint them ) { me = this . balance ; them = h . balance ; }
} ) " ;
compileAndRun ( sourceCode , 22 , " Main " ) ;
@ -2090,13 +2090,13 @@ BOOST_AUTO_TEST_CASE(event)
{
char const * sourceCode = R " (
contract ClientReceipt {
event Deposit ( address indexed _from , hash indexed _id , uint _value ) ;
function deposit ( hash _id , bool _manually ) {
event Deposit ( address indexed _from , bytes32 indexed _id , uint _value ) ;
function deposit ( bytes32 _id , bool _manually ) {
if ( _manually ) {
hash s = 0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20 ;
log3 ( msg . value , s , hash 32( msg . sender ) , _id ) ;
bytes32 s = 0x19dacbf83c5de6658e14cbf7bcae5c15eca2eedecf1c66fbca928e4d351bea0f ;
log3 ( bytes32 ( msg . value ) , s , bytes 32( msg . sender ) , _id ) ;
} else
Deposit ( hash32 ( msg . sender ) , _id , msg . value ) ;
Deposit ( msg . sender , _id , msg . value ) ;
}
}
) " ;
@ -2105,12 +2105,12 @@ BOOST_AUTO_TEST_CASE(event)
u256 id ( 0x1234 ) ;
for ( bool manually : { true , false } )
{
callContractFunctionWithValue ( " deposit(hash256 ,bool) " , value , id , manually ) ;
callContractFunctionWithValue ( " deposit(bytes32 ,bool) " , value , id , manually ) ;
BOOST_REQUIRE_EQUAL ( m_logs . size ( ) , 1 ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . address , m_contractAddress ) ;
BOOST_CHECK_EQUAL ( h256 ( m_logs [ 0 ] . data ) , h256 ( u256 ( value ) ) ) ;
BOOST_REQUIRE_EQUAL ( m_logs [ 0 ] . topics . size ( ) , 3 ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 0 ] , dev : : sha3 ( string ( " Deposit(address,hash256 ,uint256) " ) ) ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 0 ] , dev : : sha3 ( string ( " Deposit(address,bytes32 ,uint256) " ) ) ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 1 ] , h256 ( m_sender ) ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 2 ] , h256 ( id ) ) ;
}
@ -2139,21 +2139,21 @@ BOOST_AUTO_TEST_CASE(event_lots_of_data)
{
char const * sourceCode = R " (
contract ClientReceipt {
event Deposit ( address _from , hash _id , uint _value , bool _flag ) ;
function deposit ( hash _id ) {
Deposit ( msg . sender , hash32 ( _id ) , msg . value , true ) ;
event Deposit ( address _from , bytes32 _id , uint _value , bool _flag ) ;
function deposit ( bytes32 _id ) {
Deposit ( msg . sender , _id , msg . value , true ) ;
}
}
) " ;
compileAndRun ( sourceCode ) ;
u256 value ( 18 ) ;
u256 id ( 0x1234 ) ;
callContractFunctionWithValue ( " deposit(hash256 ) " , value , id ) ;
callContractFunctionWithValue ( " deposit(bytes32 ) " , value , id ) ;
BOOST_REQUIRE_EQUAL ( m_logs . size ( ) , 1 ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . address , m_contractAddress ) ;
BOOST_CHECK ( m_logs [ 0 ] . data = = encodeArgs ( ( u160 ) m_sender , id , value , true ) ) ;
BOOST_REQUIRE_EQUAL ( m_logs [ 0 ] . topics . size ( ) , 1 ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 0 ] , dev : : sha3 ( string ( " Deposit(address,hash256 ,uint256,bool) " ) ) ) ;
BOOST_CHECK_EQUAL ( m_logs [ 0 ] . topics [ 0 ] , dev : : sha3 ( string ( " Deposit(address,bytes32 ,uint256,bool) " ) ) ) ;
}
BOOST_AUTO_TEST_CASE ( empty_name_input_parameter_with_named_one )
@ -2187,7 +2187,7 @@ BOOST_AUTO_TEST_CASE(sha3_multiple_arguments)
{
char const * sourceCode = R " (
contract c {
function foo ( uint a , uint b , uint c ) returns ( hash d )
function foo ( uint a , uint b , uint c ) returns ( bytes32 d )
{
d = sha3 ( a , b , c ) ;
}
@ -2205,7 +2205,7 @@ BOOST_AUTO_TEST_CASE(sha3_multiple_arguments_with_numeric_literals)
{
char const * sourceCode = R " (
contract c {
function foo ( uint a , uint16 b ) returns ( hash d )
function foo ( uint a , uint16 b ) returns ( bytes32 d )
{
d = sha3 ( a , b , 145 ) ;
}
@ -2223,11 +2223,11 @@ BOOST_AUTO_TEST_CASE(sha3_multiple_arguments_with_string_literals)
{
char const * sourceCode = R " (
contract c {
function foo ( ) returns ( hash d )
function foo ( ) returns ( bytes32 d )
{
d = sha3 ( " foo " ) ;
}
function bar ( uint a , uint16 b ) returns ( hash d )
function bar ( uint a , uint16 b ) returns ( bytes32 d )
{
d = sha3 ( a , b , 145 , " foo " ) ;
}
@ -2254,7 +2254,7 @@ BOOST_AUTO_TEST_CASE(generic_call)
contract sender {
function doSend ( address rec ) returns ( uint d )
{
string 4 signature = string 4 ( string 32 ( sha3 ( " receive(uint256) " ) ) ) ;
byte s4 signature = byte s4( byte s32( sha3 ( " receive(uint256) " ) ) ) ;
rec . call . value ( 2 ) ( signature , 23 ) ;
return receiver ( rec ) . received ( ) ;
}
@ -2290,7 +2290,7 @@ BOOST_AUTO_TEST_CASE(bytes_from_calldata_to_memory)
{
char const * sourceCode = R " (
contract C {
function ( ) returns ( hash ) {
function ( ) returns ( bytes32 ) {
return sha3 ( " abc " , msg . data ) ;
}
}
@ -3181,7 +3181,6 @@ BOOST_AUTO_TEST_CASE(pass_dynamic_arguments_to_the_base_base_with_gap)
BOOST_CHECK ( callContractFunction ( " m_i() " ) = = encodeArgs ( 4 ) ) ;
}
BOOST_AUTO_TEST_SUITE_END ( )
}