Skip to content

Commit de0c59c

Browse files
authored
chore: parameter constant expression cleanup (#1164)
1 parent 13a3406 commit de0c59c

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

params/protocol_params.go

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -187,43 +187,46 @@ func makeRegistryId(contractName string) [32]byte {
187187
}
188188

189189
const (
190+
thousand = 1000
191+
million = 1000 * 1000
192+
190193
// Default intrinsic gas cost of transactions paying for gas in alternative currencies.
191194
// Calculated to estimate 1 balance read, 1 debit, and 4 credit transactions.
192-
IntrinsicGasForAlternativeFeeCurrency uint64 = 50000
195+
IntrinsicGasForAlternativeFeeCurrency uint64 = 50 * thousand
193196

194197
// Contract communication gas limits
195-
MaxGasForCalculateTargetEpochPaymentAndRewards uint64 = 2000000
196-
MaxGasForCommitments uint64 = 2000000
197-
MaxGasForComputeCommitment uint64 = 2000000
198-
MaxGasForBlockRandomness uint64 = 2000000
199-
MaxGasForDebitGasFeesTransactions uint64 = 1000000
200-
MaxGasForCreditGasFeesTransactions uint64 = 1000000
201-
MaxGasForDistributeEpochPayment uint64 = 1 * 1000000
202-
MaxGasForDistributeEpochRewards uint64 = 1 * 1000000
203-
MaxGasForElectValidators uint64 = 50 * 1000000
204-
MaxGasForElectNValidatorSigners uint64 = 50 * 1000000
205-
MaxGasForGetAddressFor uint64 = 1 * 100000
206-
MaxGasForGetElectableValidators uint64 = 1 * 100000
207-
MaxGasForGetEligibleValidatorGroupsVoteTotals uint64 = 1 * 1000000
208-
MaxGasForGetGasPriceMinimum uint64 = 2000000
209-
MaxGasForGetGroupEpochRewards uint64 = 500 * 1000
210-
MaxGasForGetMembershipInLastEpoch uint64 = 1 * 1000000
211-
MaxGasForGetOrComputeTobinTax uint64 = 1000000
212-
MaxGasForGetRegisteredValidators uint64 = 2000000
213-
MaxGasForGetValidator uint64 = 100 * 1000
214-
MaxGasForGetWhiteList uint64 = 200000
215-
MaxGasForGetTransferWhitelist uint64 = 2000000
216-
MaxGasForIncreaseSupply uint64 = 50 * 1000
217-
MaxGasForIsFrozen uint64 = 20000
218-
MaxGasForMedianRate uint64 = 100000
219-
MaxGasForReadBlockchainParameter uint64 = 20000
220-
MaxGasForRevealAndCommit uint64 = 2000000
221-
MaxGasForUpdateGasPriceMinimum uint64 = 2000000
222-
MaxGasForUpdateTargetVotingYield uint64 = 2000000
223-
MaxGasForUpdateValidatorScore uint64 = 1 * 1000000
224-
MaxGasForTotalSupply uint64 = 50 * 1000
225-
MaxGasForMintGas uint64 = 50 * 100000
226-
MaxGasToReadErc20Balance uint64 = 100000
227-
MaxGasForIsReserveLow uint64 = 1000000
228-
MaxGasForGetCarbonOffsettingPartner uint64 = 20000
198+
MaxGasForCalculateTargetEpochPaymentAndRewards uint64 = 2 * million
199+
MaxGasForCommitments uint64 = 2 * million
200+
MaxGasForComputeCommitment uint64 = 2 * million
201+
MaxGasForBlockRandomness uint64 = 2 * million
202+
MaxGasForDebitGasFeesTransactions uint64 = 1 * million
203+
MaxGasForCreditGasFeesTransactions uint64 = 1 * million
204+
MaxGasForDistributeEpochPayment uint64 = 1 * million
205+
MaxGasForDistributeEpochRewards uint64 = 1 * million
206+
MaxGasForElectValidators uint64 = 50 * million
207+
MaxGasForElectNValidatorSigners uint64 = 50 * million
208+
MaxGasForGetAddressFor uint64 = 100 * thousand
209+
MaxGasForGetElectableValidators uint64 = 100 * thousand
210+
MaxGasForGetEligibleValidatorGroupsVoteTotals uint64 = 1 * million
211+
MaxGasForGetGasPriceMinimum uint64 = 2 * million
212+
MaxGasForGetGroupEpochRewards uint64 = 500 * thousand
213+
MaxGasForGetMembershipInLastEpoch uint64 = 1 * million
214+
MaxGasForGetOrComputeTobinTax uint64 = 1 * million
215+
MaxGasForGetRegisteredValidators uint64 = 2 * million
216+
MaxGasForGetValidator uint64 = 100 * thousand
217+
MaxGasForGetWhiteList uint64 = 200 * thousand
218+
MaxGasForGetTransferWhitelist uint64 = 2 * million
219+
MaxGasForIncreaseSupply uint64 = 50 * thousand
220+
MaxGasForIsFrozen uint64 = 20 * thousand
221+
MaxGasForMedianRate uint64 = 100 * thousand
222+
MaxGasForReadBlockchainParameter uint64 = 20 * thousand
223+
MaxGasForRevealAndCommit uint64 = 2 * million
224+
MaxGasForUpdateGasPriceMinimum uint64 = 2 * million
225+
MaxGasForUpdateTargetVotingYield uint64 = 2 * million
226+
MaxGasForUpdateValidatorScore uint64 = 1 * million
227+
MaxGasForTotalSupply uint64 = 50 * thousand
228+
MaxGasForMintGas uint64 = 5 * million
229+
MaxGasToReadErc20Balance uint64 = 100 * thousand
230+
MaxGasForIsReserveLow uint64 = 1 * million
231+
MaxGasForGetCarbonOffsettingPartner uint64 = 20 * thousand
229232
)

0 commit comments

Comments
 (0)