Support Linea chain (#259)

This commit is contained in:
KirillPamPam
2023-07-26 14:38:05 +04:00
committed by GitHub
parent e6e1d0c9c8
commit 6a1ee930a4
6 changed files with 14 additions and 3 deletions

View File

@@ -149,6 +149,8 @@ Currently, dshackle supports next chains (should be used as chain names in confi
- bitcoin (bitcoin-testnet) - bitcoin (bitcoin-testnet)
- base - base
- base-goerli - base-goerli
- linea
- linea-goerli
=== Roles and Fallback upstream === Roles and Fallback upstream

View File

@@ -23,7 +23,9 @@ enum class BlockchainType {
chain == Chain.ZKSYNC__TESTNET || chain == Chain.ZKSYNC__TESTNET ||
chain == Chain.POLYGON_POS__MUMBAI || chain == Chain.POLYGON_POS__MUMBAI ||
chain == Chain.BASE__MAINNET || chain == Chain.BASE__MAINNET ||
chain == Chain.BASE__GOERLI chain == Chain.BASE__GOERLI ||
chain == Chain.LINEA__MAINNET ||
chain == Chain.LINEA__GOERLI
) { ) {
return EVM_POS return EVM_POS
} }

View File

@@ -48,6 +48,7 @@ enum class Chain(val id: Int, val chainCode: String, val chainName: String) {
), ),
ZKSYNC__MAINNET(1009, "ZKSYNC", "ZkSync Era"), ZKSYNC__MAINNET(1009, "ZKSYNC", "ZkSync Era"),
BASE__MAINNET(1010, "BASE", "Base"), BASE__MAINNET(1010, "BASE", "Base"),
LINEA__MAINNET(1011, "LINEA", "Linea"),
// Testnets // Testnets
ETHEREUM__MORDEN(10001, "MORDEN", "Morden Testnet"), ETHEREUM__MORDEN(10001, "MORDEN", "Morden Testnet"),
@@ -86,7 +87,8 @@ enum class Chain(val id: Int, val chainCode: String, val chainName: String) {
"POLYGON_POS_MUMBAI", "POLYGON_POS_MUMBAI",
"Polygon POS Mumbai Testnet" "Polygon POS Mumbai Testnet"
), ),
BASE__GOERLI(10014, "BASE_GOERLI", "Base Goerli Testnet"); BASE__GOERLI(10014, "BASE_GOERLI", "Base Goerli Testnet"),
LINEA__GOERLI(10015, "LINEA_GOERLI", "Linea Goerli Testnet");
companion object { companion object {
fun byId(id: Int): Chain { fun byId(id: Int): Chain {

View File

@@ -79,6 +79,8 @@ class Global {
"polygon-mumbai" to Chain.POLYGON_POS__MUMBAI, "polygon-mumbai" to Chain.POLYGON_POS__MUMBAI,
"base" to Chain.BASE__MAINNET, "base" to Chain.BASE__MAINNET,
"base-goerli" to Chain.BASE__GOERLI, "base-goerli" to Chain.BASE__GOERLI,
"linea" to Chain.LINEA__MAINNET,
"linea-goerli" to Chain.LINEA__GOERLI,
) )
fun chainById(id: String?): Chain { fun chainById(id: String?): Chain {

View File

@@ -274,6 +274,9 @@ class DefaultEthereumMethods(
Chain.BASE__MAINNET to HardcodedData("\"8453\"", "\"0x2105\""), Chain.BASE__MAINNET to HardcodedData("\"8453\"", "\"0x2105\""),
Chain.BASE__GOERLI to HardcodedData("\"84531\"", "\"0x14a33\""), Chain.BASE__GOERLI to HardcodedData("\"84531\"", "\"0x14a33\""),
Chain.LINEA__MAINNET to HardcodedData("\"59144\"", "\"0xe708\""),
Chain.LINEA__GOERLI to HardcodedData("\"59140\"", "\"0xe704\""),
) )
override fun executeHardcoded(method: String): ByteArray { override fun executeHardcoded(method: String): ByteArray {