Polkadex-Substrate / polkadexTEE-worker

Polkadex Off-chain Orderbook
Apache License 2.0
10 stars 1 forks source link

Place Order RPC Call is not Returning UUID #295

Closed zktony closed 3 years ago

zktony commented 3 years ago

Place Order RPC Call should return UUID, but its returning following response :- RpcReturnValue { value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], do_watch: true, status: Ok }

simonsso commented 3 years ago

Please fix and create a PR

zktony commented 3 years ago

Change MarketType from "Trusted" to "Spot" on Frontend side :

Order {
            user_uid: account_details.signer_public_key().into(),
            market_id: MarketId { base: AssetId::BTC, quote: AssetId::USD },
            market_type: vec![116, 114, 117, 115, 116, 101, 100] --> [115, 112, 111, 116]
            order_type: OrderType::LIMIT,
            side: OrderSide::BID,
            quantity: 1,
            price: Some(100)
        };

Also this is how success response should look like :-

wscat --connect ws://openfinex.polkadex.trade:8020
Connected (press CTRL+C to quit)
> {"jsonrpc":"2.0","method":"place_order","params":[150,198,95,101,44,65,56,120,147,98,167,214,15,54,122,91,223,13,75,80,218,60,85,237,95,168,90,14,228,139,146,80,201,2,1,4,212,53,147,199,21,253,211,28,97,20,26,189,4,169,159,214,130,44,133,88,133,76,205,227,154,86,132,231,165,109,162,125,212,53,147,199,21,253,211,28,97,20,26,189,4,169,159,214,130,44,133,88,133,76,205,227,154,86,132,231,165,109,162,125,3,4,16,115,112,111,116,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,92,130,203,165,255,49,175,51,52,249,178,252,255,77,59,196,179,45,204,20,49,252,72,81,190,90,222,104,120,90,230,32,198,121,205,248,138,148,74,145,154,182,134,250,160,155,139,13,242,223,254,67,110,83,84,47,129,178,187,68,97,28,152,141],"id":1}
< {"jsonrpc":"2.0","result":[64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],"id":1}
< {"jsonrpc":"2.0","result":[148,144,97,101,97,102,102,101,98,54,45,50,50,56,102,45,49,49,101,99,45,56,50,57,52,45,48,50,52,50,97,99,49,54,48,48,48,55,0,0],"id":1}

Ignore first response and consider second response. [148,144,97,101,97,102,102,101,98,54,45,50,50,56,102,45,49,49,101,99,45,56,50,57,52,45,48,50,52,50,97,99,49,54,48,48,48,55,0,0] --> OrderUUID

CC @AdrielVBomfim @nuel77 @charleslukes