@@ -5,8 +5,8 @@ use std::time::Duration;
5
5
use mithril_aggregator:: Configuration ;
6
6
use mithril_common:: {
7
7
entities:: {
8
- CardanoDbBeacon , Epoch , ProtocolParameters , SignedEntityType ,
9
- SignedEntityTypeDiscriminants , StakeDistributionParty , TimePoint ,
8
+ CardanoDbBeacon , ProtocolParameters , SignedEntityType , SignedEntityTypeDiscriminants ,
9
+ TimePoint ,
10
10
} ,
11
11
test_utils:: MithrilFixtureBuilder ,
12
12
} ;
@@ -59,75 +59,35 @@ async fn open_message_expiration() {
59
59
. unwrap ( ) ;
60
60
cycle_err ! ( tester, "signing" ) ;
61
61
62
- comment ! ( "signers send their single signature" ) ;
63
- tester
64
- . send_single_signatures (
65
- SignedEntityTypeDiscriminants :: MithrilStakeDistribution ,
66
- & fixture. signers_fixture ( ) ,
67
- )
68
- . await
69
- . unwrap ( ) ;
70
-
71
- comment ! ( "The state machine should issue a certificate for the MithrilStakeDistribution" ) ;
72
- cycle ! ( tester, "ready" ) ;
73
- assert_last_certificate_eq ! (
74
- tester,
75
- ExpectedCertificate :: new(
76
- CardanoDbBeacon :: new( "devnet" . to_string( ) , 1 , 2 ) ,
77
- StakeDistributionParty :: from_signers( fixture. signers_with_stake( ) ) . as_slice( ) ,
78
- fixture. compute_and_encode_avk( ) ,
79
- SignedEntityType :: MithrilStakeDistribution ( Epoch ( 1 ) ) ,
80
- ExpectedCertificate :: genesis_identifier( & CardanoDbBeacon :: new(
81
- "devnet" . to_string( ) ,
82
- 1 ,
83
- 1
84
- ) ) ,
85
- )
86
- ) ;
87
-
88
- comment ! ( "The state machine should get back to signing to sign CardanoImmutableFilesFull" ) ;
89
- // todo!: remove this immutable increase:
90
- // right now because we only have one state machine for all signed entity type we need it else
91
- // the state machine will stay in the idle state since its beacon didn't change.
92
- // With one state machine per signed entity type this problem will disappear.
93
- tester. increase_immutable_number ( ) . await . unwrap ( ) ;
94
- cycle ! ( tester, "signing" ) ;
95
-
96
62
comment ! (
97
- "Schedule the open message for CardanoImmutableFilesFull to expire, and wait until it does"
63
+ "Schedule the open message for MithrilStakeDistribution to expire, and wait until it does"
98
64
) ;
99
65
let open_message_timeout = Duration :: from_millis ( 100 ) ;
100
66
tester
101
67
. activate_open_message_expiration (
102
- SignedEntityTypeDiscriminants :: CardanoImmutableFilesFull ,
68
+ SignedEntityTypeDiscriminants :: MithrilStakeDistribution ,
103
69
open_message_timeout,
104
70
)
105
71
. await
106
72
. unwrap ( ) ;
107
73
tokio:: time:: sleep ( 2 * open_message_timeout) . await ;
108
- let signers_for_immutables = & fixture. signers_fixture ( ) [ 0 ..=6 ] ;
74
+
75
+ comment ! ( "signers send their single signature" ) ;
109
76
tester
110
77
. send_single_signatures (
111
- SignedEntityTypeDiscriminants :: CardanoImmutableFilesFull ,
112
- signers_for_immutables ,
78
+ SignedEntityTypeDiscriminants :: MithrilStakeDistribution ,
79
+ & fixture . signers_fixture ( ) ,
113
80
)
114
81
. await
115
82
. unwrap ( ) ;
116
83
117
- comment ! ( "The state machine should not issue a certificate for the CardanoImmutableFilesFull " ) ;
84
+ comment ! ( "The state machine should not issue a certificate for the MithrilStakeDistribution " ) ;
118
85
cycle ! ( tester, "ready" ) ;
119
86
assert_last_certificate_eq ! (
120
87
tester,
121
- ExpectedCertificate :: new(
122
- CardanoDbBeacon :: new( "devnet" . to_string( ) , 1 , 2 ) ,
123
- StakeDistributionParty :: from_signers( fixture. signers_with_stake( ) ) . as_slice( ) ,
124
- fixture. compute_and_encode_avk( ) ,
125
- SignedEntityType :: MithrilStakeDistribution ( Epoch ( 1 ) ) ,
126
- ExpectedCertificate :: genesis_identifier( & CardanoDbBeacon :: new(
127
- "devnet" . to_string( ) ,
128
- 1 ,
129
- 1
130
- ) ) ,
88
+ ExpectedCertificate :: new_genesis(
89
+ CardanoDbBeacon :: new( "devnet" . to_string( ) , 1 , 1 ) ,
90
+ fixture. compute_and_encode_avk( )
131
91
)
132
92
) ;
133
93
@@ -150,7 +110,7 @@ async fn open_message_expiration() {
150
110
assert_last_certificate_eq ! (
151
111
tester,
152
112
ExpectedCertificate :: new(
153
- CardanoDbBeacon :: new( "devnet" . to_string( ) , 1 , 4 ) ,
113
+ CardanoDbBeacon :: new( "devnet" . to_string( ) , 1 , 3 ) ,
154
114
& signers_for_immutables
155
115
. iter( )
156
116
. map( |s| s. signer_with_stake. clone( ) . into( ) )
@@ -159,7 +119,7 @@ async fn open_message_expiration() {
159
119
SignedEntityType :: CardanoImmutableFilesFull ( CardanoDbBeacon :: new(
160
120
"devnet" . to_string( ) ,
161
121
1 ,
162
- 4
122
+ 3
163
123
) ) ,
164
124
ExpectedCertificate :: genesis_identifier( & CardanoDbBeacon :: new(
165
125
"devnet" . to_string( ) ,
0 commit comments