ContextMock.sol 697 B

123456789101112131415161718192021222324252627
  1. pragma solidity ^0.5.0;
  2. import "../GSN/Context.sol";
  3. contract ContextMock is Context {
  4. event Sender(address sender);
  5. function msgSender() public {
  6. emit Sender(_msgSender());
  7. }
  8. event Data(bytes data, uint256 integerValue, string stringValue);
  9. function msgData(uint256 integerValue, string memory stringValue) public {
  10. emit Data(_msgData(), integerValue, stringValue);
  11. }
  12. }
  13. contract ContextMockCaller {
  14. function callSender(ContextMock context) public {
  15. context.msgSender();
  16. }
  17. function callData(ContextMock context, uint256 integerValue, string memory stringValue) public {
  18. context.msgData(integerValue, stringValue);
  19. }
  20. }