Skip to content

Commit 429e4ab

Browse files
committed
fix: all testing
1 parent f7b38bd commit 429e4ab

File tree

7 files changed

+29
-4
lines changed

7 files changed

+29
-4
lines changed

tests/e2e/steps_start_chains.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
3939
ConsumerChain: ChainID(consumerName),
4040
SpawnTime: 0,
4141
InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1},
42+
TopN: 100, // All validators must validate (100% = Replicated Security)
4243
},
4344
State: State{
4445
ChainID("provi"): ChainState{

testutil/keeper/unit_test_helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal {
280280
types.DefaultCCVTimeoutPeriod,
281281
types.DefaultTransferTimeoutPeriod,
282282
types.DefaultConsumerUnbondingPeriod,
283+
100, // TopN = 100 for replicated security
283284
).(*providertypes.ConsumerAdditionProposal)
284285

285286
return prop

x/ccv/provider/client/legacy_proposal_handler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ Where proposal.json contains:
8383
proposal.GenesisHash, proposal.BinaryHash, proposal.SpawnTime,
8484
proposal.ConsumerRedistributionFraction, proposal.BlocksPerDistributionTransmission,
8585
proposal.DistributionTransmissionChannel, proposal.HistoricalEntries,
86-
proposal.CcvTimeoutPeriod, proposal.TransferTimeoutPeriod, proposal.UnbondingPeriod)
86+
proposal.CcvTimeoutPeriod, proposal.TransferTimeoutPeriod, proposal.UnbondingPeriod,
87+
proposal.TopN)
8788

8889
from := clientCtx.GetFromAddress()
8990

x/ccv/provider/keeper/legacy_proposal_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func TestHandleLegacyConsumerAdditionProposal(t *testing.T) {
5757
100000000000,
5858
100000000000,
5959
100000000000,
60+
0, // Opt-in chain - doesn't require validators at startup
6061
).(*providertypes.ConsumerAdditionProposal),
6162
blockTime: now,
6263
expAppendProp: true,
@@ -82,6 +83,7 @@ func TestHandleLegacyConsumerAdditionProposal(t *testing.T) {
8283
100000000000,
8384
100000000000,
8485
100000000000,
86+
0, // Opt-in chain - doesn't require validators at startup
8587
).(*providertypes.ConsumerAdditionProposal),
8688
blockTime: now,
8789
expAppendProp: false,

x/ccv/provider/keeper/proposal_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func TestHandleConsumerAdditionProposal(t *testing.T) {
6767
100000000000,
6868
100000000000,
6969
100000000000,
70+
0, // Opt-in chain - doesn't require validators at startup
7071
).(*providertypes.ConsumerAdditionProposal),
7172
blockTime: now,
7273
expAppendProp: true,
@@ -92,6 +93,7 @@ func TestHandleConsumerAdditionProposal(t *testing.T) {
9293
100000000000,
9394
100000000000,
9495
100000000000,
96+
0, // Opt-in chain - doesn't require validators at startup
9597
).(*providertypes.ConsumerAdditionProposal),
9698
blockTime: now,
9799
expAppendProp: false,

x/ccv/provider/types/legacy_proposal.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func NewConsumerAdditionProposal(title, description, chainID string,
5353
ccvTimeoutPeriod time.Duration,
5454
transferTimeoutPeriod time.Duration,
5555
unbondingPeriod time.Duration,
56+
topN uint32,
5657
) govv1beta1.Content {
5758
return &ConsumerAdditionProposal{
5859
Title: title,
@@ -69,6 +70,7 @@ func NewConsumerAdditionProposal(title, description, chainID string,
6970
CcvTimeoutPeriod: ccvTimeoutPeriod,
7071
TransferTimeoutPeriod: transferTimeoutPeriod,
7172
UnbondingPeriod: unbondingPeriod,
73+
Top_N: topN,
7274
}
7375
}
7476

x/ccv/provider/types/legacy_proposal_test.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
3636
100000000000,
3737
100000000000,
3838
100000000000,
39+
100,
3940
),
4041
true,
4142
},
@@ -49,6 +50,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
4950
100000000000,
5051
100000000000,
5152
100000000000,
53+
100,
5254
),
5355
true,
5456
},
@@ -62,6 +64,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
6264
100000000000,
6365
100000000000,
6466
100000000000,
67+
100,
6568
),
6669
false,
6770
},
@@ -75,6 +78,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
7578
100000000000,
7679
100000000000,
7780
100000000000,
81+
100,
7882
),
7983
false,
8084
},
@@ -108,6 +112,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
108112
100000000000,
109113
100000000000,
110114
100000000000,
115+
100,
111116
),
112117
false,
113118
},
@@ -120,7 +125,8 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
120125
10000,
121126
100000000000,
122127
100000000000,
123-
100000000000),
128+
100000000000,
129+
100),
124130
false,
125131
},
126132
{
@@ -133,6 +139,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
133139
100000000000,
134140
100000000000,
135141
100000000000,
142+
100,
136143
),
137144
false,
138145
},
@@ -146,6 +153,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
146153
100000000000,
147154
100000000000,
148155
100000000000,
156+
100,
149157
),
150158
false,
151159
},
@@ -159,6 +167,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
159167
100000000000,
160168
100000000000,
161169
100000000000,
170+
100,
162171
),
163172
false,
164173
},
@@ -172,6 +181,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
172181
100000000000,
173182
100000000000,
174183
100000000000,
184+
100,
175185
),
176186
false,
177187
},
@@ -185,6 +195,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
185195
100000000000,
186196
100000000000,
187197
100000000000,
198+
100,
188199
),
189200
false,
190201
},
@@ -198,6 +209,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
198209
0,
199210
100000000000,
200211
100000000000,
212+
100,
201213
),
202214
false,
203215
},
@@ -211,6 +223,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
211223
100000000000,
212224
0,
213225
100000000000,
226+
100,
214227
),
215228
false,
216229
},
@@ -224,6 +237,7 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) {
224237
100000000000,
225238
100000000000,
226239
0,
240+
100,
227241
),
228242
false,
229243
},
@@ -248,7 +262,8 @@ func TestMarshalConsumerAdditionProposal(t *testing.T) {
248262
10000,
249263
100000000000,
250264
100000000000,
251-
100000000000)
265+
100000000000,
266+
100)
252267

253268
cccp, ok := content.(*types.ConsumerAdditionProposal)
254269
require.True(t, ok)
@@ -290,7 +305,8 @@ func TestConsumerAdditionProposalString(t *testing.T) {
290305
500000,
291306
100000000000,
292307
10000000000,
293-
100000000000)
308+
100000000000,
309+
100)
294310

295311
expect := fmt.Sprintf(`CreateConsumerChain Proposal
296312
Title: title

0 commit comments

Comments
 (0)