Skip to content

Commit

Permalink
Hardcode active markets to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lumos42 committed May 11, 2024
1 parent 5e48e59 commit eae0e39
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/evm/orderbook/config_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ func (cs *ConfigService) GetPriceMultiplier(market Market) *big.Int {
}

func (cs *ConfigService) GetActiveMarketsCount() int64 {
return bibliophile.GetActiveMarketsCount(cs.getStateAtCurrentBlock())
return 0
// return bibliophile.GetActiveMarketsCount(cs.getStateAtCurrentBlock())
}

func (cs *ConfigService) GetUnderlyingPrices() []*big.Int {
Expand Down
1 change: 1 addition & 0 deletions plugin/evm/orderbook/matching_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ type Orders struct {
}

func (pipeline *MatchingPipeline) GetActiveMarkets() []Market {
return []Market{}
count := pipeline.configService.GetActiveMarketsCount()
markets := make([]Market, count)
for i := int64(0); i < count; i++ {
Expand Down
2 changes: 2 additions & 0 deletions precompile/contracts/bibliophile/clearing_house.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ func marketsStorageSlot() *big.Int {
}

func GetActiveMarketsCount(stateDB contract.StateDB) int64 {
return 0
rawVal := stateDB.GetState(common.HexToAddress(CLEARING_HOUSE_GENESIS_ADDRESS), common.BytesToHash(common.LeftPadBytes(big.NewInt(AMMS_SLOT).Bytes(), 32)))
return new(big.Int).SetBytes(rawVal.Bytes()).Int64()
}

func GetMarkets(stateDB contract.StateDB) []common.Address {
return []common.Address{}
numMarkets := GetActiveMarketsCount(stateDB)
markets := make([]common.Address, numMarkets)
baseStorageSlot := marketsStorageSlot()
Expand Down
1 change: 1 addition & 0 deletions precompile/contracts/bibliophile/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (b *bibliophileClient) GetSignedOrderStatus(orderHash [32]byte) int64 {
}

func (b *bibliophileClient) GetActiveMarketsCount() int64 {
return 0
return GetActiveMarketsCount(b.accessibleState.GetStateDB())
}

Expand Down

0 comments on commit eae0e39

Please sign in to comment.