Skip to content

Commit

Permalink
resolve shubhams comments
Browse files Browse the repository at this point in the history
  • Loading branch information
atvanguard committed Dec 29, 2023
1 parent edfd06e commit 8179e43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugin/evm/orderbook/config_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type IConfigService interface {

GetSignedOrderStatus(orderHash common.Hash) int64
IsTradingAuthority(trader, signer common.Address) bool
GetChainIdAndSignedOrderbookContract() common.Address
GetSignedOrderbookContract() common.Address
}

type ConfigService struct {
Expand Down Expand Up @@ -112,6 +112,6 @@ func (cs *ConfigService) IsTradingAuthority(trader, signer common.Address) bool
return bibliophile.IsTradingAuthority(cs.getStateAtCurrentBlock(), trader, signer)
}

func (cs *ConfigService) GetChainIdAndSignedOrderbookContract() common.Address {
func (cs *ConfigService) GetSignedOrderbookContract() common.Address {
return bibliophile.GetSignedOrderBookAddress(cs.getStateAtCurrentBlock())
}
2 changes: 1 addition & 1 deletion plugin/evm/orderbook/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,6 @@ func NewMockConfigService() *MockConfigService {
return &MockConfigService{}
}

func (cs *MockConfigService) GetChainIdAndSignedOrderbookContract() common.Address {
func (cs *MockConfigService) GetSignedOrderbookContract() common.Address {
return common.Address{}
}
4 changes: 2 additions & 2 deletions plugin/evm/orderbook/trading_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ type PlaceOrderResponse struct {
Success bool `json:"success"`
}

func (api *TradingAPI) PostOrder(ctx context.Context, rawOrder string) (PlaceOrderResponse, error) {
func (api *TradingAPI) PlaceSignedOrder(ctx context.Context, rawOrder string) (PlaceOrderResponse, error) {
// fmt.Println("rawOrder", rawOrder)
testData, err := hex.DecodeString(strings.TrimPrefix(rawOrder, "0x"))
if err != nil {
Expand All @@ -331,7 +331,7 @@ func (api *TradingAPI) PostOrder(ctx context.Context, rawOrder string) (PlaceOrd

marketId := int(order.AmmIndex.Int64())
if hu.ChainId == 0 { // set once, will need to restart node if we change
hu.SetChainIdAndVerifyingSignedOrdersContract(api.backend.ChainConfig().ChainID.Int64(), api.configService.GetChainIdAndSignedOrderbookContract().String())
hu.SetChainIdAndVerifyingSignedOrdersContract(api.backend.ChainConfig().ChainID.Int64(), api.configService.GetSignedOrderbookContract().String())
}
orderId, err := order.Hash()
if err != nil {
Expand Down

0 comments on commit 8179e43

Please sign in to comment.