From 8179e436e5221d71c8905f71f89fc564c9f6dafb Mon Sep 17 00:00:00 2001 From: atvanguard <3612498+atvanguard@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:42:06 +0000 Subject: [PATCH] resolve shubhams comments --- plugin/evm/orderbook/config_service.go | 4 ++-- plugin/evm/orderbook/mocks.go | 2 +- plugin/evm/orderbook/trading_apis.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/evm/orderbook/config_service.go b/plugin/evm/orderbook/config_service.go index db22a688b2..1fb898be99 100644 --- a/plugin/evm/orderbook/config_service.go +++ b/plugin/evm/orderbook/config_service.go @@ -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 { @@ -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()) } diff --git a/plugin/evm/orderbook/mocks.go b/plugin/evm/orderbook/mocks.go index 9419c34dbe..cc047ea6cf 100644 --- a/plugin/evm/orderbook/mocks.go +++ b/plugin/evm/orderbook/mocks.go @@ -311,6 +311,6 @@ func NewMockConfigService() *MockConfigService { return &MockConfigService{} } -func (cs *MockConfigService) GetChainIdAndSignedOrderbookContract() common.Address { +func (cs *MockConfigService) GetSignedOrderbookContract() common.Address { return common.Address{} } diff --git a/plugin/evm/orderbook/trading_apis.go b/plugin/evm/orderbook/trading_apis.go index 442f13999d..94ed0b70a7 100644 --- a/plugin/evm/orderbook/trading_apis.go +++ b/plugin/evm/orderbook/trading_apis.go @@ -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 { @@ -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 {