Change Mapping example to valid (executable) code

Current example will not compile and would need to be compiled in separate files, unlike how it is shown (see https://github.com/ethereum/solidity/pull/2618).

The proposed changes provide both a source code that compiles and a easier to understand Contract creation (using new instead of a contract address).
This commit is contained in:
Antonio Tenorio-Fornés 2017-07-24 18:30:54 +02:00 committed by GitHub
parent cfb11ff7ec
commit db739dff69

View File

@ -815,9 +815,10 @@ for each ``_KeyType``, recursively.
}
contract MappingUser {
address contractAddress = 0x42;
function f() returns (uint) {
return MappingExample(contractAddress).balances(this);
MappingExample m = new MappingExample();
m.update(100);
return m.balances(this);
}
}