Skip to content

Commit ec76f25

Browse files
committed
vm: use PrecompiledContracts type alias for consistency
Replace raw map[common.Address]PrecompiledContract type declarations with PrecompiledContracts type alias in variable declarations and struct fields for improved code consistency and readability. Signed-off-by: katsumata <[email protected]>
1 parent e3f85bf commit ec76f25

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

core/vm/contracts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var PrecompiledContractsVerkle = PrecompiledContractsPrague
144144

145145
// PrecompiledContractsFjord contains the default set of pre-compiled Ethereum
146146
// contracts used in the Fjord release.
147-
var PrecompiledContractsFjord = map[common.Address]PrecompiledContract{
147+
var PrecompiledContractsFjord = PrecompiledContracts{
148148
common.BytesToAddress([]byte{1}): &ecrecover{},
149149
common.BytesToAddress([]byte{2}): &sha256hash{},
150150
common.BytesToAddress([]byte{3}): &ripemd160hash{},
@@ -160,7 +160,7 @@ var PrecompiledContractsFjord = map[common.Address]PrecompiledContract{
160160

161161
// PrecompiledContractsGranite contains the default set of pre-compiled Ethereum
162162
// contracts used in the Granite release.
163-
var PrecompiledContractsGranite = map[common.Address]PrecompiledContract{
163+
var PrecompiledContractsGranite = PrecompiledContracts{
164164
common.BytesToAddress([]byte{1}): &ecrecover{},
165165
common.BytesToAddress([]byte{2}): &sha256hash{},
166166
common.BytesToAddress([]byte{3}): &ripemd160hash{},
@@ -174,7 +174,7 @@ var PrecompiledContractsGranite = map[common.Address]PrecompiledContract{
174174
common.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{},
175175
}
176176

177-
var PrecompiledContractsIsthmus = map[common.Address]PrecompiledContract{
177+
var PrecompiledContractsIsthmus = PrecompiledContracts{
178178
common.BytesToAddress([]byte{1}): &ecrecover{},
179179
common.BytesToAddress([]byte{2}): &sha256hash{},
180180
common.BytesToAddress([]byte{3}): &ripemd160hash{},

core/vm/contracts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type precompiledFailureTest struct {
4646

4747
// allPrecompiles does not map to the actual set of precompiles, as it also contains
4848
// repriced versions of precompiles at certain slots
49-
var allPrecompiles = map[common.Address]PrecompiledContract{
49+
var allPrecompiles = PrecompiledContracts{
5050
common.BytesToAddress([]byte{1}): &ecrecover{},
5151
common.BytesToAddress([]byte{2}): &sha256hash{},
5252
common.BytesToAddress([]byte{3}): &ripemd160hash{},

core/vm/evm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type EVM struct {
128128
callGasTemp uint64
129129

130130
// precompiles holds the precompiled contracts for the current epoch
131-
precompiles map[common.Address]PrecompiledContract
131+
precompiles PrecompiledContracts
132132

133133
// jumpDests is the aggregated result of JUMPDEST analysis made through
134134
// the life cycle of EVM.

0 commit comments

Comments
 (0)