diff --git a/src/DKG.sol b/src/DKG.sol index d406b3c..6013783 100644 --- a/src/DKG.sol +++ b/src/DKG.sol @@ -69,10 +69,7 @@ contract DKG is IThresholdNetwork { // event emitted when the DKG is ready to start event NewParticipant(address from, uint32 index, uint256 tmpKey); - // TODO change when this is fixed https://github.com/gakonst/ethers-rs/issues/1220 - event DealBundleSubmitted( - uint256 dealerIdx, Bn128.G1Point random, uint32[] indices, uint256[] shares, Bn128.G1Point[] commitment - ); + event DealBundleSubmitted(uint256 dealerIdx, DealBundle bundle); event ValidComplaint(address from, uint32 evicted); constructor(DKGFactory _factory) { @@ -115,7 +112,7 @@ contract DKG is IThresholdNetwork { } function emitDealBundle(uint32 _index, DealBundle memory _bundle) private { - emit DealBundleSubmitted(_index, _bundle.random, _bundle.indices, _bundle.encryptedShares, _bundle.commitment); + emit DealBundleSubmitted(_index, _bundle); } // TODO diff --git a/src/EncryptionOracle.sol b/src/EncryptionOracle.sol index 63fe6e6..b3926de 100644 --- a/src/EncryptionOracle.sol +++ b/src/EncryptionOracle.sol @@ -19,11 +19,9 @@ interface IEncryptionOracle is IThresholdNetwork { function requestReencryption(uint256 _cipherId, Bn128.G1Point memory _publickey) external returns (uint256); // returns the ciphertext id function submitCiphertext(Ciphertext memory _cipher) external returns (uint256); - // TODO Fix with a proper struct once - // https://github.com/gakonst/ethers-rs/issues/1219 is fixed - event NewCiphertext(uint256 indexed id, uint256 rx, uint256 ry, uint256 cipher, address client); - event ReencryptionRequest(uint256 indexed cipherId, uint256 requestId, uint256 pubx, uint256 puby, address client); + event NewCiphertext(uint256 indexed id, Ciphertext ciphertext, address client); + event ReencryptionRequest(uint256 indexed cipherId, uint256 requestId, Bn128.G1Point publicKey, address client); } error RequestDoesNotExist(); @@ -66,7 +64,7 @@ abstract contract EncryptionOracle is IEncryptionOracle { function submitCiphertext(IEncryptionOracle.Ciphertext memory _cipher) external returns (uint256) { uint256 id = newCipherId(); - emit NewCiphertext(id, _cipher.random.x, _cipher.random.y, _cipher.cipher, msg.sender); + emit NewCiphertext(id, _cipher, msg.sender); return id; } @@ -74,11 +72,11 @@ abstract contract EncryptionOracle is IEncryptionOracle { // the public key is the public key of the recipient. Note the msg.sender // MUST be the one that submitted the ciphertext in the first place // otherwise the oracle will not reply - function requestReencryption(uint256 _cipherId, Bn128.G1Point memory _publickey) public returns (uint256) { + function requestReencryption(uint256 _cipherId, Bn128.G1Point memory _publicKey) public returns (uint256) { // TODO check correct key uint256 requestId = newRequestId(); pendingRequests[requestId] = PendingRequest(msg.sender); - emit ReencryptionRequest(_cipherId, requestId, _publickey.x, _publickey.y, msg.sender); + emit ReencryptionRequest(_cipherId, requestId, _publicKey, msg.sender); return requestId; } diff --git a/src/RoleACL.sol b/src/RoleACL.sol index c5563cb..5a3cd2c 100644 --- a/src/RoleACL.sol +++ b/src/RoleACL.sol @@ -24,17 +24,15 @@ contract RoleACL is AccessControlEnumerable, IEncryptionClient { oracle = IO(_oracleAddress); } - // TODO Fix with a proper struct once - // https://github.com/gakonst/ethers-rs/issues/1219 is fixed // request id // TODO fix by giving the ciphertext ID AND the request ID // we can't differentiate otherwise - event NewOracleResult(uint256 requestId, uint256 rx, uint256 ry, uint256 cipher); + event NewOracleResult(uint256 requestId, IO.Ciphertext ciphertext); function oracleResult(uint256 _requestId, IO.Ciphertext memory _cipher) external { require(msg.sender == address(oracle), "only oracle can submit results"); // TODO : some checks ? do we handle pending requests here etc ? - emit NewOracleResult(_requestId, _cipher.random.x, _cipher.random.y, _cipher.cipher); + emit NewOracleResult(_requestId, _cipher); } // TODO add different roles, payable etc