Skip to content

Commit 3307123

Browse files
committed
chore(gateway-contracts): rename consensus event
1 parent c9e41f1 commit 3307123

File tree

8 files changed

+92
-85
lines changed

8 files changed

+92
-85
lines changed

gateway-contracts/contracts/Decryption.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ contract Decryption is
568568
// Since we use the default value for `bytes32`, this means we do not need to store the
569569
// digest in `decryptionConsensusDigest` here like we do for the public decryption case.
570570

571-
emit UserDecryptionResponseConsensusReached(decryptionId);
571+
emit UserDecryptionResponseThresholdReached(decryptionId);
572572
}
573573
}
574574

gateway-contracts/contracts/interfaces/IDecryption.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ interface IDecryption {
9191
bytes extraData
9292
);
9393

94-
event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
94+
/**
95+
* @notice Emitted when the number of user decryption response received reaches the threshold.
96+
* @param decryptionId The decryption request ID.
97+
*/
98+
event UserDecryptionResponseThresholdReached(uint256 indexed decryptionId);
9599

96100
/// @notice Error indicating that the input list of handles is empty.
97101
error EmptyCtHandles();

gateway-contracts/contracts/mocks/DecryptionMock.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ contract DecryptionMock {
3636

3737
event UserDecryptionResponse(
3838
uint256 indexed decryptionId,
39+
uint256 counterShares,
3940
bytes userDecryptedShare,
4041
bytes signature,
4142
bytes extraData
4243
);
4344

44-
event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
45+
event UserDecryptionResponseThresholdReached(uint256 indexed decryptionId);
4546

4647
uint256 _decryptionRequestCounter;
4748

@@ -103,8 +104,10 @@ contract DecryptionMock {
103104
bytes calldata signature,
104105
bytes calldata extraData
105106
) external {
106-
emit UserDecryptionResponse(decryptionId, userDecryptedShare, signature, extraData);
107+
uint256 counterShares;
107108

108-
emit UserDecryptionResponseConsensusReached(decryptionId);
109+
emit UserDecryptionResponse(decryptionId, counterShares, userDecryptedShare, signature, extraData);
110+
111+
emit UserDecryptionResponseThresholdReached(decryptionId);
109112
}
110113
}

gateway-contracts/rust_bindings/src/decryption.rs

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

gateway-contracts/rust_bindings/src/i_decryption.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ interface IDecryption {
4848
event PublicDecryptionResponse(uint256 indexed decryptionId, bytes decryptedResult, bytes[] signatures, bytes extraData);
4949
event UserDecryptionRequest(uint256 indexed decryptionId, SnsCiphertextMaterial[] snsCtMaterials, address userAddress, bytes publicKey, bytes extraData);
5050
event UserDecryptionResponse(uint256 indexed decryptionId, uint256 counterShares, bytes userDecryptedShare, bytes signature, bytes extraData);
51-
event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
51+
event UserDecryptionResponseThresholdReached(uint256 indexed decryptionId);
5252
5353
function checkDecryptionDone(uint256 decryptionId) external view;
5454
function checkDelegatedUserDecryptionReady(uint256 contractsChainId, DelegationAccounts memory delegationAccounts, CtHandleContractPair[] memory ctHandleContractPairs, address[] memory contractAddresses, bytes memory extraData) external view;
@@ -642,7 +642,7 @@ interface IDecryption {
642642
},
643643
{
644644
"type": "event",
645-
"name": "UserDecryptionResponseConsensusReached",
645+
"name": "UserDecryptionResponseThresholdReached",
646646
"inputs": [
647647
{
648648
"name": "decryptionId",
@@ -4183,9 +4183,9 @@ event UserDecryptionResponse(uint256 indexed decryptionId, uint256 counterShares
41834183
};
41844184
#[derive(serde::Serialize, serde::Deserialize)]
41854185
#[derive(Default, Debug, PartialEq, Eq, Hash)]
4186-
/**Event with signature `UserDecryptionResponseConsensusReached(uint256)` and selector `0xf19537a90f8b15e38ebb4803912ef6d3d5b418abdab0bc27599f0ec6398094a2`.
4186+
/**Event with signature `UserDecryptionResponseThresholdReached(uint256)` and selector `0xe89752be0ecdb68b2a6eb5ef1a891039e0e92ae3c8a62274c5881e48eea1ed25`.
41874187
```solidity
4188-
event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
4188+
event UserDecryptionResponseThresholdReached(uint256 indexed decryptionId);
41894189
```*/
41904190
#[allow(
41914191
non_camel_case_types,
@@ -4194,7 +4194,7 @@ event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
41944194
clippy::style
41954195
)]
41964196
#[derive(Clone)]
4197-
pub struct UserDecryptionResponseConsensusReached {
4197+
pub struct UserDecryptionResponseThresholdReached {
41984198
#[allow(missing_docs)]
41994199
pub decryptionId: alloy::sol_types::private::primitives::aliases::U256,
42004200
}
@@ -4207,7 +4207,7 @@ event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
42074207
const _: () = {
42084208
use alloy::sol_types as alloy_sol_types;
42094209
#[automatically_derived]
4210-
impl alloy_sol_types::SolEvent for UserDecryptionResponseConsensusReached {
4210+
impl alloy_sol_types::SolEvent for UserDecryptionResponseThresholdReached {
42114211
type DataTuple<'a> = ();
42124212
type DataToken<'a> = <Self::DataTuple<
42134213
'a,
@@ -4216,11 +4216,11 @@ event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
42164216
alloy_sol_types::sol_data::FixedBytes<32>,
42174217
alloy::sol_types::sol_data::Uint<256>,
42184218
);
4219-
const SIGNATURE: &'static str = "UserDecryptionResponseConsensusReached(uint256)";
4219+
const SIGNATURE: &'static str = "UserDecryptionResponseThresholdReached(uint256)";
42204220
const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
4221-
241u8, 149u8, 55u8, 169u8, 15u8, 139u8, 21u8, 227u8, 142u8, 187u8, 72u8,
4222-
3u8, 145u8, 46u8, 246u8, 211u8, 213u8, 180u8, 24u8, 171u8, 218u8, 176u8,
4223-
188u8, 39u8, 89u8, 159u8, 14u8, 198u8, 57u8, 128u8, 148u8, 162u8,
4221+
232u8, 151u8, 82u8, 190u8, 14u8, 205u8, 182u8, 139u8, 42u8, 110u8, 181u8,
4222+
239u8, 26u8, 137u8, 16u8, 57u8, 224u8, 233u8, 42u8, 227u8, 200u8, 166u8,
4223+
34u8, 116u8, 197u8, 136u8, 30u8, 72u8, 238u8, 161u8, 237u8, 37u8,
42244224
]);
42254225
const ANONYMOUS: bool = false;
42264226
#[allow(unused_variables)]
@@ -4273,7 +4273,7 @@ event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
42734273
}
42744274
#[automatically_derived]
42754275
impl alloy_sol_types::private::IntoLogData
4276-
for UserDecryptionResponseConsensusReached {
4276+
for UserDecryptionResponseThresholdReached {
42774277
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
42784278
From::from(self)
42794279
}
@@ -4282,11 +4282,11 @@ event UserDecryptionResponseConsensusReached(uint256 indexed decryptionId);
42824282
}
42834283
}
42844284
#[automatically_derived]
4285-
impl From<&UserDecryptionResponseConsensusReached>
4285+
impl From<&UserDecryptionResponseThresholdReached>
42864286
for alloy_sol_types::private::LogData {
42874287
#[inline]
42884288
fn from(
4289-
this: &UserDecryptionResponseConsensusReached,
4289+
this: &UserDecryptionResponseThresholdReached,
42904290
) -> alloy_sol_types::private::LogData {
42914291
alloy_sol_types::SolEvent::encode_log_data(this)
42924292
}
@@ -7576,7 +7576,7 @@ function userDecryptionResponse(uint256 decryptionId, bytes memory userDecrypted
75767576
#[allow(missing_docs)]
75777577
UserDecryptionResponse(UserDecryptionResponse),
75787578
#[allow(missing_docs)]
7579-
UserDecryptionResponseConsensusReached(UserDecryptionResponseConsensusReached),
7579+
UserDecryptionResponseThresholdReached(UserDecryptionResponseThresholdReached),
75807580
}
75817581
#[automatically_derived]
75827582
impl IDecryptionEvents {
@@ -7603,9 +7603,9 @@ function userDecryptionResponse(uint256 decryptionId, bytes memory userDecrypted
76037603
189u8, 127u8, 248u8, 93u8, 76u8, 113u8, 94u8, 248u8, 209u8, 95u8,
76047604
],
76057605
[
7606-
241u8, 149u8, 55u8, 169u8, 15u8, 139u8, 21u8, 227u8, 142u8, 187u8, 72u8,
7607-
3u8, 145u8, 46u8, 246u8, 211u8, 213u8, 180u8, 24u8, 171u8, 218u8, 176u8,
7608-
188u8, 39u8, 89u8, 159u8, 14u8, 198u8, 57u8, 128u8, 148u8, 162u8,
7606+
232u8, 151u8, 82u8, 190u8, 14u8, 205u8, 182u8, 139u8, 42u8, 110u8, 181u8,
7607+
239u8, 26u8, 137u8, 16u8, 57u8, 224u8, 233u8, 42u8, 227u8, 200u8, 166u8,
7608+
34u8, 116u8, 197u8, 136u8, 30u8, 72u8, 238u8, 161u8, 237u8, 37u8,
76097609
],
76107610
[
76117611
249u8, 1u8, 27u8, 214u8, 186u8, 13u8, 166u8, 4u8, 156u8, 82u8, 13u8,
@@ -7660,13 +7660,13 @@ function userDecryptionResponse(uint256 decryptionId, bytes memory userDecrypted
76607660
.map(Self::UserDecryptionResponse)
76617661
}
76627662
Some(
7663-
<UserDecryptionResponseConsensusReached as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
7663+
<UserDecryptionResponseThresholdReached as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
76647664
) => {
7665-
<UserDecryptionResponseConsensusReached as alloy_sol_types::SolEvent>::decode_raw_log(
7665+
<UserDecryptionResponseThresholdReached as alloy_sol_types::SolEvent>::decode_raw_log(
76667666
topics,
76677667
data,
76687668
)
7669-
.map(Self::UserDecryptionResponseConsensusReached)
7669+
.map(Self::UserDecryptionResponseThresholdReached)
76707670
}
76717671
_ => {
76727672
alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
@@ -7698,7 +7698,7 @@ function userDecryptionResponse(uint256 decryptionId, bytes memory userDecrypted
76987698
Self::UserDecryptionResponse(inner) => {
76997699
alloy_sol_types::private::IntoLogData::to_log_data(inner)
77007700
}
7701-
Self::UserDecryptionResponseConsensusReached(inner) => {
7701+
Self::UserDecryptionResponseThresholdReached(inner) => {
77027702
alloy_sol_types::private::IntoLogData::to_log_data(inner)
77037703
}
77047704
}
@@ -7717,7 +7717,7 @@ function userDecryptionResponse(uint256 decryptionId, bytes memory userDecrypted
77177717
Self::UserDecryptionResponse(inner) => {
77187718
alloy_sol_types::private::IntoLogData::into_log_data(inner)
77197719
}
7720-
Self::UserDecryptionResponseConsensusReached(inner) => {
7720+
Self::UserDecryptionResponseThresholdReached(inner) => {
77217721
alloy_sol_types::private::IntoLogData::into_log_data(inner)
77227722
}
77237723
}
@@ -8108,11 +8108,11 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/
81088108
) -> alloy_contract::Event<&P, UserDecryptionResponse, N> {
81098109
self.event_filter::<UserDecryptionResponse>()
81108110
}
8111-
///Creates a new event filter for the [`UserDecryptionResponseConsensusReached`] event.
8112-
pub fn UserDecryptionResponseConsensusReached_filter(
8111+
///Creates a new event filter for the [`UserDecryptionResponseThresholdReached`] event.
8112+
pub fn UserDecryptionResponseThresholdReached_filter(
81138113
&self,
8114-
) -> alloy_contract::Event<&P, UserDecryptionResponseConsensusReached, N> {
8115-
self.event_filter::<UserDecryptionResponseConsensusReached>()
8114+
) -> alloy_contract::Event<&P, UserDecryptionResponseThresholdReached, N> {
8115+
self.event_filter::<UserDecryptionResponseThresholdReached>()
81168116
}
81178117
}
81188118
}

gateway-contracts/selectors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ Decryption
170170
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
171171
| Event | UserDecryptionRequest(uint256,(bytes32,uint256,bytes32,address[])[],address,bytes,bytes) | 0xf9011bd6ba0da6049c520d70fe5971f17ed7ab795486052544b51019896c596b |
172172
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
173-
| Event | UserDecryptionResponse(uint256,bytes,bytes,bytes) | 0x66aef293eb75c368842ba263f2b40b9f8da2b36a95a3ac952d701b0b1c4cd509 |
173+
| Event | UserDecryptionResponse(uint256,uint256,bytes,bytes,bytes) | 0x7fcdfb5381917f554a717d0a5470a33f5a49ba6445f05ec43c74c0bc2cc608b2 |
174174
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
175-
| Event | UserDecryptionResponseConsensusReached(uint256) | 0xf19537a90f8b15e38ebb4803912ef6d3d5b418abdab0bc27599f0ec6398094a2 |
175+
| Event | UserDecryptionResponseThresholdReached(uint256) | 0xe89752be0ecdb68b2a6eb5ef1a891039e0e92ae3c8a62274c5881e48eea1ed25 |
176176
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
177177
| Error | AddressEmptyCode(address) | 0x9996b315 |
178178
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
@@ -1101,9 +1101,9 @@ DecryptionV2Example
11011101
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
11021102
| Event | UserDecryptionRequest(uint256,(bytes32,uint256,bytes32,address[])[],address,bytes,bytes) | 0xf9011bd6ba0da6049c520d70fe5971f17ed7ab795486052544b51019896c596b |
11031103
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
1104-
| Event | UserDecryptionResponse(uint256,bytes,bytes,bytes) | 0x66aef293eb75c368842ba263f2b40b9f8da2b36a95a3ac952d701b0b1c4cd509 |
1104+
| Event | UserDecryptionResponse(uint256,uint256,bytes,bytes,bytes) | 0x7fcdfb5381917f554a717d0a5470a33f5a49ba6445f05ec43c74c0bc2cc608b2 |
11051105
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
1106-
| Event | UserDecryptionResponseConsensusReached(uint256) | 0xf19537a90f8b15e38ebb4803912ef6d3d5b418abdab0bc27599f0ec6398094a2 |
1106+
| Event | UserDecryptionResponseThresholdReached(uint256) | 0xe89752be0ecdb68b2a6eb5ef1a891039e0e92ae3c8a62274c5881e48eea1ed25 |
11071107
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
11081108
| Error | AddressEmptyCode(address) | 0x9996b315 |
11091109
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
@@ -1942,9 +1942,9 @@ IDecryption
19421942
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
19431943
| Event | UserDecryptionRequest(uint256,(bytes32,uint256,bytes32,address[])[],address,bytes,bytes) | 0xf9011bd6ba0da6049c520d70fe5971f17ed7ab795486052544b51019896c596b |
19441944
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
1945-
| Event | UserDecryptionResponse(uint256,bytes,bytes,bytes) | 0x66aef293eb75c368842ba263f2b40b9f8da2b36a95a3ac952d701b0b1c4cd509 |
1945+
| Event | UserDecryptionResponse(uint256,uint256,bytes,bytes,bytes) | 0x7fcdfb5381917f554a717d0a5470a33f5a49ba6445f05ec43c74c0bc2cc608b2 |
19461946
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
1947-
| Event | UserDecryptionResponseConsensusReached(uint256) | 0xf19537a90f8b15e38ebb4803912ef6d3d5b418abdab0bc27599f0ec6398094a2 |
1947+
| Event | UserDecryptionResponseThresholdReached(uint256) | 0xe89752be0ecdb68b2a6eb5ef1a891039e0e92ae3c8a62274c5881e48eea1ed25 |
19481948
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
19491949
| Error | ContractAddressesMaxLengthExceeded(uint8,uint256) | 0xc5ab467e |
19501950
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
@@ -2369,9 +2369,9 @@ DecryptionMock
23692369
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
23702370
| Event | UserDecryptionRequest(uint256,(bytes32,uint256,bytes32,address[])[],address,bytes,bytes) | 0xf9011bd6ba0da6049c520d70fe5971f17ed7ab795486052544b51019896c596b |
23712371
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
2372-
| Event | UserDecryptionResponse(uint256,bytes,bytes,bytes) | 0x66aef293eb75c368842ba263f2b40b9f8da2b36a95a3ac952d701b0b1c4cd509 |
2372+
| Event | UserDecryptionResponse(uint256,uint256,bytes,bytes,bytes) | 0x7fcdfb5381917f554a717d0a5470a33f5a49ba6445f05ec43c74c0bc2cc608b2 |
23732373
|----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------|
2374-
| Event | UserDecryptionResponseConsensusReached(uint256) | 0xf19537a90f8b15e38ebb4803912ef6d3d5b418abdab0bc27599f0ec6398094a2 |
2374+
| Event | UserDecryptionResponseThresholdReached(uint256) | 0xe89752be0ecdb68b2a6eb5ef1a891039e0e92ae3c8a62274c5881e48eea1ed25 |
23752375
╰----------+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------╯
23762376

23772377

0 commit comments

Comments
 (0)