From 1f2949848d7cab1cf3c96db84188334998735b27 Mon Sep 17 00:00:00 2001 From: aarifkhamdi Date: Wed, 4 Sep 2024 13:55:09 +0500 Subject: [PATCH] add filecoin methods --- .../upstream/calls/DefaultEthereumMethods.kt | 154 +++++++++++++++++- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index 9042310af..94a45cd5c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -204,6 +204,156 @@ class DefaultEthereumMethods( "eth_chainId", ) + private val filecoinMethods = listOf( + "Filecoin.ChainBlockstoreInfo", + "Filecoin.ChainExport", + "Filecoin.ChainGetBlock", + "Filecoin.ChainGetBlockMessages", + "Filecoin.ChainGetEvents", + "Filecoin.ChainGetGenesis", + "Filecoin.ChainGetMessage", + "Filecoin.ChainGetMessagesInTipset", + "Filecoin.ChainGetNode", + "Filecoin.ChainGetParentMessages", + "Filecoin.ChainGetParentReceipts", + "Filecoin.ChainGetPath", + "Filecoin.ChainGetTipSet", + "Filecoin.ChainGetTipSetAfterHeight", + "Filecoin.ChainGetTipSetByHeight", + "Filecoin.ChainHasObj", + "Filecoin.ChainHead", + "Filecoin.ChainHotGC", + "Filecoin.ChainNotify", + "Filecoin.ChainReadObj", + "Filecoin.ChainStatObj", + "Filecoin.ChainTipSetWeight", + "Filecoin.ClientDealPieceCID", + "Filecoin.ClientDealSize", + "Filecoin.ClientFindData", + "Filecoin.ClientGetDealInfo", + "Filecoin.ClientGetDealStatus", + "Filecoin.ClientMinerQueryOffer", + "Filecoin.ClientQueryAsk", + "Filecoin.GasEstimateFeeCap", + "Filecoin.GasEstimateGasLimit", + "Filecoin.GasEstimateGasPremium", + "Filecoin.GasEstimateMessageGas", + "Filecoin.ID", + "Filecoin.MinerGetBaseInfo", + "Filecoin.MpoolCheckMessages", + "Filecoin.MpoolCheckPendingMessages", + "Filecoin.MpoolCheckReplaceMessages", + "Filecoin.MpoolGetConfig", + "Filecoin.MpoolGetNonce", + "Filecoin.MpoolPending", + "Filecoin.MpoolPush", + "Filecoin.MpoolSelect", + "Filecoin.MpoolSub", + "Filecoin.MsigGetAvailableBalance", + "Filecoin.MsigGetPending", + "Filecoin.MsigGetVested", + "Filecoin.MsigGetVestingSchedule", + "Filecoin.NetAddrsListen", + "Filecoin.NetAgentVersion", + "Filecoin.NetAutoNatStatus", + "Filecoin.NetBandwidthStats", + "Filecoin.NetBandwidthStatsByPeer", + "Filecoin.NetBandwidthStatsByProtocol", + "Filecoin.NetBlockList", + "Filecoin.NetConnectedness", + "Filecoin.NetFindPeer", + "Filecoin.NetLimit", + "Filecoin.NetListening", + "Filecoin.NetPeerInfo", + "Filecoin.NetPeers", + "Filecoin.NetPing", + "Filecoin.NetProtectList", + "Filecoin.NetPubsubScores", + "Filecoin.NetStat", + "Filecoin.NetVersion", + "Filecoin.NodeStatus", + "Filecoin.PaychList", + "Filecoin.PaychStatus", + "Filecoin.PaychVoucherCheckSpendable", + "Filecoin.PaychVoucherCheckValid", + "Filecoin.RaftLeader", + "Filecoin.RaftState", + "Filecoin.StartTime", + "Filecoin.StateAccountKey", + "Filecoin.StateActorCodeCIDs", + "Filecoin.StateActorManifestCID", + "Filecoin.StateAllMinerFaults", + "Filecoin.StateCall", + "Filecoin.StateChangedActors", + "Filecoin.StateCirculatingSupply", + "Filecoin.StateCompute", + "Filecoin.StateComputeDataCID", + "Filecoin.StateDealProviderCollateralBounds", + "Filecoin.StateDecodeParams", + "Filecoin.StateEncodeParams", + "Filecoin.StateGetActor", + "Filecoin.StateGetAllocation", + "Filecoin.StateGetAllocationForPendingDeal", + "Filecoin.StateGetAllocations", + "Filecoin.StateGetBeaconEntry", + "Filecoin.StateGetClaim", + "Filecoin.StateGetClaims", + "Filecoin.StateGetNetworkParams", + "Filecoin.StateGetRandomnessDigestFromBeacon", + "Filecoin.StateGetRandomnessDigestFromTickets", + "Filecoin.StateGetRandomnessFromBeacon", + "Filecoin.StateGetRandomnessFromTickets", + "Filecoin.StateGetReceipt", + "Filecoin.StateListActors", + "Filecoin.StateListMessages", + "Filecoin.StateListMiners", + "Filecoin.StateLookupID", + "Filecoin.StateLookupRobustAddress", + "Filecoin.StateMarketBalance", + "Filecoin.StateMarketDeals", + "Filecoin.StateMarketParticipants", + "Filecoin.StateMarketStorageDeal", + "Filecoin.StateMinerActiveSectors", + "Filecoin.StateMinerAllocated", + "Filecoin.StateMinerAvailableBalance", + "Filecoin.StateMinerDeadlines", + "Filecoin.StateMinerFaults", + "Filecoin.StateMinerInfo", + "Filecoin.StateMinerInitialPledgeCollateral", + "Filecoin.StateMinerPartitions", + "Filecoin.StateMinerPower", + "Filecoin.StateMinerPreCommitDepositForPower", + "Filecoin.StateMinerProvingDeadline", + "Filecoin.StateMinerRecoveries", + "Filecoin.StateMinerSectorAllocated", + "Filecoin.StateMinerSectorCount", + "Filecoin.StateMinerSectors", + "Filecoin.StateNetworkName", + "Filecoin.StateNetworkVersion", + "Filecoin.StateReadState", + "Filecoin.StateReplay", + "Filecoin.StateSearchMsg", + "Filecoin.StateSearchMsgLimited", + "Filecoin.StateSectorExpiration", + "Filecoin.StateSectorGetInfo", + "Filecoin.StateSectorPartition", + "Filecoin.StateSectorPreCommitInfo", + "Filecoin.StateVerifiedClientStatus", + "Filecoin.StateVerifiedRegistryRootKey", + "Filecoin.StateVerifierStatus", + "Filecoin.StateVMCirculatingSupplyInternal", + "Filecoin.StateWaitMsg", + "Filecoin.StateWaitMsgLimited", + "Filecoin.SyncCheckBad", + "Filecoin.SyncIncomingBlocks", + "Filecoin.SyncState", + "Filecoin.SyncValidateTipset", + "Filecoin.WalletBalance", + "Filecoin.WalletValidateAddress", + "Filecoin.WalletVerify", + "Filecoin.Web3ClientVersion", + ) + private val klayMethods = listOf( "klay_accountCreated", "klay_accounts", @@ -348,7 +498,7 @@ class DefaultEthereumMethods( specialMethods.contains(method) || harmonySpecialMethods.contains(method) || klaySpecialMethods.contains(method) -> { when (method) { "eth_getTransactionCount", "hmy_getTransactionCount", "klay_getTransactionCount" -> MaximumValueQuorum() - "eth_sendRawTransaction", "hmy_sendRawStakingTransaction", "hmy_sendRawTransaction", "klay_sendRawTransaction" -> BroadcastQuorum() + "eth_sendRawTransaction", "hmy_sendRawStakingTransaction", "hmy_sendRawTransaction", "klay_sendRawTransaction", "Filecoin.MpoolPush" -> BroadcastQuorum() else -> AlwaysQuorum() } } @@ -461,6 +611,8 @@ class DefaultEthereumMethods( "buildTransaction", ) + Chain.FILECOIN__MAINNET, Chain.FILECOIN__CALIBRATION_TESTNET -> filecoinMethods + else -> emptyList() } }