laconicd-deprecated/tests/solidity/suites/basic/contracts/TestMessageCall.sol
yihuang 7c7f3f02bb
tests: add message call benchmark (#717)
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-11-08 13:04:49 +00:00

26 lines
517 B
Solidity

pragma solidity 0.5.17;
contract Inner {
event TestEvent(uint256);
function test() public returns (uint256) {
emit TestEvent(42);
return 42;
}
}
contract TestMessageCall {
Inner _inner;
constructor() public {
_inner = new Inner();
}
// benchmarks
function benchmarkMessageCall(uint iterations) public returns (uint256) {
uint256 n = 0;
for (uint i=0; i < iterations; i++) {
n += _inner.test();
}
return n;
}
}