1
1
package org .cardanofoundation .rosetta .common .mapper ;
2
2
3
- import java .math .BigDecimal ;
4
3
import java .math .BigInteger ;
5
4
import java .util .Map ;
6
5
@@ -38,24 +37,16 @@ void merge_Test_ok() {
38
37
ProtocolParams from = ProtocolParams .builder ()
39
38
.costModels (Map .of ("key3" , new long []{4 }))
40
39
.minPoolCost (BigInteger .valueOf (5 ))
41
- .committeeMinSize (null )
42
- .committeeMaxTermLength (6 )
43
40
.build ();
44
41
ProtocolParams to = ProtocolParams .builder ()
45
- .costModelsHash ("costHash6" )
46
42
.minPoolCost (BigInteger .valueOf (7 ))
47
- .committeeMinSize (8 )
48
- .committeeMaxTermLength (null )
49
43
.build ();
50
44
ProtocolParams merged = my .merge (from , to );
51
45
52
46
assertThat (merged .getCostModels ()).hasSize (1 );
53
47
assertThat (merged .getCostModels ().keySet ()).containsAll (from .getCostModels ().keySet ());
54
48
assertThat (merged .getCostModels ().values ()).containsAll (from .getCostModels ().values ());
55
49
assertThat (merged .getMinPoolCost ()).isEqualTo (from .getMinPoolCost ());
56
- assertThat (merged .getCommitteeMinSize ()).isEqualTo (to .getCommitteeMinSize ());
57
- assertThat (merged .getCommitteeMaxTermLength ()).isEqualTo (from .getCommitteeMaxTermLength ());
58
- assertThat (merged .getCostModelsHash ()).isEqualTo (to .getCostModelsHash ());
59
50
}
60
51
61
52
private EpochParamEntity newEpochParamEntity () {
@@ -65,81 +56,32 @@ private EpochParamEntity newEpochParamEntity() {
65
56
private ProtocolParamsEntity newEpochParams () {
66
57
return ProtocolParamsEntity
67
58
.builder ()
68
- .decentralisationParam (BigDecimal .valueOf (1 ))
69
59
.adaPerUtxoByte (BigInteger .valueOf (2 ))
70
- .committeeMaxTermLength (3 )
71
- .committeeMinSize (4 )
72
- .drepDeposit (BigInteger .valueOf (5 ))
73
- .collateralPercent (6 )
74
- .costModelsHash ("costModelsHash7" )
75
60
.costModels (Map .of ("key1" , new long []{0 }))
76
- .extraEntropy ("extraEntropy8" )
77
- .expansionRate (BigDecimal .valueOf (9 ))
78
61
.keyDeposit (BigInteger .valueOf (10 ))
79
- .maxBlockExMem (BigInteger .valueOf (11 ))
80
- .maxBlockHeaderSize (12 )
81
- .maxBlockExSteps (BigInteger .valueOf (13 ))
82
- .maxBlockExMem (BigInteger .valueOf (14 ))
83
- .maxBlockSize (15 )
84
- .maxEpoch (16 )
85
- .maxTxExMem (BigInteger .valueOf (17 ))
86
- .maxTxExSteps (BigInteger .valueOf (18 ))
87
62
.maxTxSize (19 )
88
63
.minFeeA (20 )
89
64
.minFeeB (21 )
90
65
.minPoolCost (BigInteger .valueOf (22 ))
91
- .minUtxo (BigInteger .valueOf (23 ))
92
- .nOpt (24 )
93
66
.poolDeposit (BigInteger .valueOf (25 ))
94
- .poolPledgeInfluence (BigDecimal .valueOf (26 ))
95
- .priceMem (BigDecimal .valueOf (27 ))
96
- .priceStep (BigDecimal .valueOf (28 ))
97
67
.protocolMajorVer (29 )
98
68
.protocolMinorVer (30 )
99
- .treasuryGrowthRate (BigDecimal .valueOf (31 ))
100
69
.maxValSize (32L )
101
70
.maxCollateralInputs (33 )
102
- .govActionDeposit (BigInteger .valueOf (34 ))
103
- .govActionLifetime (35 )
104
- .drepActivity (36 )
105
71
.build ();
106
72
}
107
73
108
74
private void assertProtocolParameters (ProtocolParams into , ProtocolParamsEntity param ) {
109
- assertThat (into .getDecentralisationParam ()).isEqualTo (param .getDecentralisationParam ());
110
75
assertThat (into .getAdaPerUtxoByte ()).isEqualTo (param .getAdaPerUtxoByte ());
111
- assertThat (into .getCommitteeMaxTermLength ()).isEqualTo (param .getCommitteeMaxTermLength ());
112
- assertThat (into .getCommitteeMinSize ()).isEqualTo (param .getCommitteeMinSize ());
113
- assertThat (into .getDrepDeposit ()).isEqualTo (param .getDrepDeposit ());
114
- assertThat (into .getCollateralPercent ()).isEqualTo (param .getCollateralPercent ());
115
- assertThat (into .getCostModelsHash ()).isEqualTo (param .getCostModelsHash ());
116
- assertThat (into .getExtraEntropy ().getTag ()).isEqualTo (param .getExtraEntropy ());
117
- assertThat (into .getExpansionRate ()).isEqualTo (param .getExpansionRate ());
118
76
assertThat (into .getKeyDeposit ()).isEqualTo (param .getKeyDeposit ());
119
- assertThat (into .getMaxBlockHeaderSize ()).isEqualTo (param .getMaxBlockHeaderSize ());
120
- assertThat (into .getMaxBlockBodySize ()).isEqualTo (param .getMaxBlockSize ());
121
- assertThat (into .getMaxBlockExSteps ()).isEqualTo (param .getMaxBlockExSteps ());
122
- assertThat (into .getMaxBlockExMem ()).isEqualTo (param .getMaxBlockExMem ());
123
- assertThat (into .getMaxEpoch ()).isEqualTo (param .getMaxEpoch ());
124
- assertThat (into .getMaxTxExMem ()).isEqualTo (param .getMaxTxExMem ());
125
- assertThat (into .getMaxTxExSteps ()).isEqualTo (param .getMaxTxExSteps ());
126
77
assertThat (into .getMaxTxSize ()).isEqualTo (param .getMaxTxSize ());
127
78
assertThat (into .getMinFeeA ()).isEqualTo (param .getMinFeeA ());
128
79
assertThat (into .getMinFeeB ()).isEqualTo (param .getMinFeeB ());
129
80
assertThat (into .getMinPoolCost ()).isEqualTo (param .getMinPoolCost ());
130
- assertThat (into .getMinUtxoValue ()).isEqualTo (param .getMinUtxo ());
131
- assertThat (into .getNOpt ()).isEqualTo (param .getNOpt ());
132
81
assertThat (into .getPoolDeposit ()).isEqualTo (param .getPoolDeposit ());
133
- assertThat (into .getPoolPledgeInfluence ()).isEqualTo (param .getPoolPledgeInfluence ());
134
- assertThat (into .getPriceMem ()).isEqualTo (param .getPriceMem ());
135
- assertThat (into .getPriceStep ()).isEqualTo (param .getPriceStep ());
136
82
assertThat (into .getProtocolVersion ().getMajor ()).isEqualTo (param .getProtocolMajorVer ());
137
83
assertThat (into .getProtocolVersion ().getMinor ()).isEqualTo (param .getProtocolMinorVer ());
138
- assertThat (into .getTreasuryGrowthRate ()).isEqualTo (param .getTreasuryGrowthRate ());
139
84
assertThat (into .getMaxValSize ()).isEqualTo (param .getMaxValSize ());
140
85
assertThat (into .getMaxCollateralInputs ()).isEqualTo (param .getMaxCollateralInputs ());
141
- assertThat (into .getGovActionDeposit ()).isEqualTo (param .getGovActionDeposit ());
142
- assertThat (into .getGovActionLifetime ()).isEqualTo (param .getGovActionLifetime ());
143
- assertThat (into .getDrepActivity ()).isEqualTo (param .getDrepActivity ());
144
86
}
145
87
}
0 commit comments