diff --git a/internal/quaiapi/backend.go b/internal/quaiapi/backend.go index 7b926e20f2..06ba4cdf9a 100644 --- a/internal/quaiapi/backend.go +++ b/internal/quaiapi/backend.go @@ -106,6 +106,7 @@ type Backend interface { SetDomInterface(domInterface core.CoreBackend) BroadcastWorkShare(workShare *types.WorkObjectShareView, location common.Location) error GetMaxTxInWorkShare() uint64 + GetExpansionNumber() uint8 BadHashExistsInChain() bool IsBlockHashABadHash(hash common.Hash) bool diff --git a/internal/quaiapi/quai_api.go b/internal/quaiapi/quai_api.go index ca351cbeb8..f30e04d2fb 100644 --- a/internal/quaiapi/quai_api.go +++ b/internal/quaiapi/quai_api.go @@ -856,9 +856,8 @@ func (s *PublicBlockChainQuaiAPI) ListRunningChains() []common.Location { return s.b.GetSlicesRunning() } -func (s *PublicBlockChainQuaiAPI) GetProtocolExpansionNumber() int { - // TODO: Implement this - return 0 +func (s *PublicBlockChainQuaiAPI) GetProtocolExpansionNumber() hexutil.Uint { + return hexutil.Uint(s.b.GetExpansionNumber()) } // Calculate the amount of Quai that Qi can be converted to. Expect the current Header and the Qi amount in "qits", returns the quai amount in "its" diff --git a/quai/api_backend.go b/quai/api_backend.go index e95aedf21b..842f04df80 100644 --- a/quai/api_backend.go +++ b/quai/api_backend.go @@ -530,6 +530,10 @@ func (b *QuaiAPIBackend) SetCurrentExpansionNumber(expansionNumber uint8) { b.quai.core.SetCurrentExpansionNumber(expansionNumber) } +func (b *QuaiAPIBackend) GetExpansionNumber() uint8 { + return b.quai.core.GetExpansionNumber() +} + func (b *QuaiAPIBackend) WriteGenesisBlock(block *types.WorkObject, location common.Location) { b.quai.core.WriteGenesisBlock(block, location) }