refactor: change Dispatch event

buddies-main-deployment
James Prestwich 4 years ago
parent 81707b3237
commit e95634a610
No known key found for this signature in database
GPG Key ID: 75A7F5C06D747046
  1. 12
      solidity/contracts/Home.sol

@ -16,8 +16,7 @@ contract Home is MerkleTreeManager, QueueManager, Common {
event Dispatch(
uint32 indexed destination,
uint32 indexed sequence,
// the message is after this root. Some future update will contain it.
bytes32 indexed current,
bytes32 indexed leaf,
bytes message
);
event ImproperUpdate();
@ -48,8 +47,8 @@ contract Home is MerkleTreeManager, QueueManager, Common {
uint32 sequence = sequences[destination] + 1;
sequences[destination] = sequence;
bytes32 _digest =
Message.messageHash(
bytes memory _message =
Message.formatMessage(
originSLIP44,
bytes32(uint256(uint160(msg.sender))),
sequence,
@ -57,10 +56,11 @@ contract Home is MerkleTreeManager, QueueManager, Common {
recipient,
body
);
bytes32 _leaf = keccak256(_message);
tree.insert(_digest);
tree.insert(_leaf);
queue.enqueue(root());
emit Dispatch(destination, sequence, current, body);
emit Dispatch(destination, sequence, _leaf, _message);
}
function update(

Loading…
Cancel
Save