Skip to content

Commit

Permalink
Implemented protocol expansion number
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Aug 23, 2024
1 parent e8d94fe commit 2ef3dc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/quaiapi/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions internal/quaiapi/quai_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions quai/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 2ef3dc9

Please sign in to comment.