Skip to content

Commit

Permalink
add subscriptions test
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Oct 10, 2023
1 parent 814037b commit a737a8c
Show file tree
Hide file tree
Showing 2 changed files with 465 additions and 2 deletions.
31 changes: 31 additions & 0 deletions integration/obscurogateway/events_contract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: MIT
// Specify the Solidity version
pragma solidity ^0.8.0;

contract SimpleMessageContract {

// State variable to store the message
string public message;
string public message2;

// Event declaration
event MessageUpdatedWithAddress(string newMessage, address indexed sender);
event Message2Updated(string newMessage);

// Constructor to initialize the message
constructor() {
message = "foo";
message2 = "foo";
}

// Function to set a new message
function setMessage(string memory newMessage) public {
message = newMessage;
emit MessageUpdatedWithAddress(newMessage, msg.sender); // Emit the event (only sender can see it)
}

function setMessage2(string memory newMessage) public {
message2 = newMessage;
emit Message2Updated(newMessage); // Emit the event (everyone can see it)
}
}
Loading

0 comments on commit a737a8c

Please sign in to comment.