Skip to content

Instantly share code, notes, and snippets.

@feuGeneA
Created June 12, 2020 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feuGeneA/5b0f91576a8ed8669d984185e11b2261 to your computer and use it in GitHub Desktop.
Save feuGeneA/5b0f91576a8ed8669d984185e11b2261 to your computer and use it in GitHub Desktop.
$ yarn test:rest && yarn test:rfqt
$ ETHEREUM_RPC_URL=http://localhost:8545 CHAIN_ID=1337 RFQT_API_KEY_WHITELIST='koolApiKey1,koolApikey2' RFQT_MAKER_ASSET_OFFERINGS='{"https://mock-rfqt1.club": [["0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c","0x0b1ba0af832d7c05fd64161e0db78e85978e8082"]]}' META_TXN_RELAY_ADDRESS=0x9eFCa436873b55a0d6AEa260f92DE50150360dca META_TXN_RELAY_PRIVATE_KEY=82b9c3b8d45f608badd8fda250a0d95088381540e850734519b659e1e1ac3e71 mocha --exclude lib/test/rfqt_test.js --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --timeout 200000 --exit
meta transactions tests
[meta transactions tests-start] $ node -r dotenv/config lib/src/index.js
[meta transactions tests-start] {"level":"error","time":1592002985264,"pid":26692,"hostname":"precision5510","msg":"TypeError: contract_wrappers_1.ITransformERC20Contract is not a constructor\n at new ExchangeProxySwapQuoteConsumer (/home/gene/dev/0x-api/node_modules/@0x/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts:58:34)\n at new SwapQuoteConsumer (/home/gene/dev/0x-api/node_modules/@0x/asset-swapper/src/quote_consumers/swap_quote_consumer.ts:50:39)\n at new SwapService (/home/gene/dev/0x-api/src/services/swap_service.ts:75:35)\n at createSwapServiceFromOrderBookService (/home/gene/dev/0x-api/src/app.ts:139:12)\n at Object.<anonymous> (/home/gene/dev/0x-api/src/app.ts:68:23)\n at Generator.next (<anonymous>)\n at fulfilled (/home/gene/dev/0x-api/lib/src/app.js:4:58)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)","v":1}
[meta transactions tests-start] WARNING: Multiple definitions for safeTransferFrom
[meta transactions tests-start] {"level":"error","time":1592002986419,"pid":26692,"hostname":"precision5510","msg":"API running without swap service","v":1}
[meta transactions tests-start] {"level":"info","time":1592002986420,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService starting up!","v":1}
[meta transactions tests-start] {"level":"info","time":1592002986420,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592002986424,"pid":26692,"hostname":"precision5510","msg":"API (HTTP) listening on port 3000!","v":1}
[meta transactions tests-start] {"level":"warn","time":1592002986439,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592002986440,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":0,\"sent\":0}","v":1}
[meta transactions tests-start] {"level":"info","time":1592002986440,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
/price tests
failure tests
✓ missing query params
[meta transactions tests-start] {"level":"info","time":1592002986581,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"sellToken\",\"code\":1000,\"reason\":\"requires property \\\"sellToken\\\"\"},{\"field\":\"buyToken\",\"code\":1000,\"reason\":\"requires property \\\"buyToken\\\"\"},{\"field\":\"takerAddress\",\"code\":1000,\"reason\":\"requires property \\\"takerAddress\\\"\"},{\"field\":\"instance\",\"code\":1001,\"reason\":\"is not exactly one from <sellAmount>,<buyAmount>\"}]}"},"responseTime":11,"timestamp":1592002986580,"v":1}
✓ both `sellAmount` and `buyAmount`
[meta transactions tests-start] {"level":"info","time":1592002986595,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","sellAmount":"200000000000000000000","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"instance\",\"code\":1001,\"reason\":\"is not exactly one from <sellAmount>,<buyAmount>\"}]}"},"responseTime":2,"timestamp":1592002986595,"v":1}
✓ Invalid `buyToken`
[meta transactions tests-start] {"level":"info","time":1592002986604,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"INVALID","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"buyToken\",\"code\":1004,\"reason\":\"Could not find token `INVALID`\"}]}"},"responseTime":4,"timestamp":1592002986604,"v":1}
✓ Invalid `sellToken`
[meta transactions tests-start] {"level":"info","time":1592002986614,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"INVALID","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"sellToken\",\"code\":1004,\"reason\":\"Could not find token `INVALID`\"}]}"},"responseTime":5,"timestamp":1592002986614,"v":1}
✓ Insufficient Liquidity (415ms)
[meta transactions tests-start] {"level":"info","time":1592002987030,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"buyAmount\",\"code\":1004,\"reason\":\"INSUFFICIENT_ASSET_LIQUIDITY\"}]}"},"responseTime":412,"timestamp":1592002987030,"v":1}
success tests
✓ should show the price of the only order in Mesh (2475ms)
[meta transactions tests-start] {"level":"info","time":1592002992109,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":250,"timestamp":1592002992109,"v":1}
[meta transactions tests-start] {"level":"info","time":1592002997799,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592002997799,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592002997803,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592002997907,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":1,\"sent\":1}","v":1}
[meta transactions tests-start] {"level":"info","time":1592002997911,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
✓ should show the price of the cheaper order in Mesh (2510ms)
[meta transactions tests-start] {"level":"info","time":1592003010131,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":275,"timestamp":1592003010131,"v":1}
[meta transactions tests-start] {"level":"info","time":1592003015701,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003015701,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003015711,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003015958,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":2,\"sent\":2}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003015961,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
✓ should show the price of the combination of the two orders in Mesh (2499ms)
[meta transactions tests-start] {"level":"info","time":1592003028245,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"2","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":310,"timestamp":1592003028245,"v":1}
[meta transactions tests-start] {"level":"info","time":1592003033850,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003033850,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003033856,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003033984,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":2,\"sent\":2}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003033987,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
/quote tests
failure tests
✓ missing query params
[meta transactions tests-start] {"level":"info","time":1592003041333,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"sellToken\",\"code\":1000,\"reason\":\"requires property \\\"sellToken\\\"\"},{\"field\":\"buyToken\",\"code\":1000,\"reason\":\"requires property \\\"buyToken\\\"\"},{\"field\":\"takerAddress\",\"code\":1000,\"reason\":\"requires property \\\"takerAddress\\\"\"},{\"field\":\"instance\",\"code\":1001,\"reason\":\"is not exactly one from <sellAmount>,<buyAmount>\"}]}"},"responseTime":1,"timestamp":1592003041333,"v":1}
✓ both `sellAmount` and `buyAmount`
[meta transactions tests-start] {"level":"info","time":1592003041337,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","sellAmount":"200000000000000000000","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"instance\",\"code\":1001,\"reason\":\"is not exactly one from <sellAmount>,<buyAmount>\"}]}"},"responseTime":2,"timestamp":1592003041337,"v":1}
✓ Invalid `buyToken`
[meta transactions tests-start] {"level":"info","time":1592003041342,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"INVALID","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"buyToken\",\"code\":1004,\"reason\":\"Could not find token `INVALID`\"}]}"},"responseTime":2,"timestamp":1592003041342,"v":1}
✓ Invalid `sellToken`
[meta transactions tests-start] {"level":"info","time":1592003041345,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"INVALID","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"sellToken\",\"code\":1004,\"reason\":\"Could not find token `INVALID`\"}]}"},"responseTime":1,"timestamp":1592003041345,"v":1}
✓ Insufficient Liquidity (72ms)
[meta transactions tests-start] {"level":"info","time":1592003041418,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":100,\"reason\":\"Validation Failed\",\"validationErrors\":[{\"field\":\"buyAmount\",\"code\":1004,\"reason\":\"INSUFFICIENT_ASSET_LIQUIDITY\"}]}"},"responseTime":70,"timestamp":1592003041418,"v":1}
success tests
✓ should return a quote of the only order in Mesh (2428ms)
[meta transactions tests-start] {"level":"info","time":1592003056745,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":215,"timestamp":1592003056745,"v":1}
[meta transactions tests-start] {"level":"info","time":1592003062345,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003062345,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003062351,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003062448,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":1,\"sent\":1}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003062451,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
✓ should return a quote of the cheaper order in Mesh (2466ms)
[meta transactions tests-start] {"level":"info","time":1592003074493,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":305,"timestamp":1592003074493,"v":1}
[meta transactions tests-start] {"level":"info","time":1592003080063,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003080063,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003080077,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003080194,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":2,\"sent\":2}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003080197,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
✓ should return a quote of the combination of the two orders in Mesh (2400ms)
[meta transactions tests-start] {"level":"info","time":1592003091950,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"2","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":252,"timestamp":1592003091950,"v":1}
[meta transactions tests-start] {"level":"info","time":1592003097510,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003097510,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003097520,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003097635,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":2,\"sent\":2}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003097637,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
/submit tests
failure tests
✓ should return InvalidAPIKey error if invalid UUID supplied as API Key
[meta transactions tests-start] {"level":"info","time":1592003104929,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/submit","method":"POST","headers":{"0x-api-key":"foobar","user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{}},"res":{"statusCode":400,"statusMessage":"Bad Request","errorBody":"{\"code\":107,\"reason\":\"Invalid API key\"}"},"responseTime":4,"timestamp":1592003104929,"v":1}
success tests
single order submission
✓ price checking yields the correct market price (206ms)
[meta transactions tests-start] {"level":"info","time":1592003109614,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/price","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":201,"timestamp":1592003109614,"v":1}
✓ the quote matches the price check (134ms)
[meta transactions tests-start] {"level":"info","time":1592003109749,"pid":26692,"hostname":"precision5510","req":{"url":"/meta_transaction/v0/quote","method":"GET","headers":{"user-agent":"node-superagent/3.8.3","host":"localhost:3000"},"body":{},"params":{},"query":{"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1","excludedSources":"Uniswap,Uniswap_V2,Uniswap_V2_ETH,Kyber,LiquidityProvider,Eth2Dai,MultiBridge","takerAddress":"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb"}},"res":{"statusCode":200,"statusMessage":"OK"},"responseTime":132,"timestamp":1592003109749,"v":1}
- submitting the quote is successful and money changes hands correctly
[meta transactions tests-start] {"level":"info","time":1592003115289,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService reconnecting to Mesh","v":1}
[meta transactions tests-start] {"level":"info","time":1592003115289,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService syncing orderbook with Mesh","v":1}
[meta transactions tests-start] {"level":"warn","time":1592003115313,"pid":26692,"hostname":"precision5510","msg":"currentEpochPoolsStatsQuery threw an error: QueryFailedError: relation \"staking.epoch_start_pool_status\" does not exist","v":1}
[meta transactions tests-start] {"level":"info","time":1592003115412,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync {\"accepted\":0,\"rejected\":1,\"sent\":1}","v":1}
[meta transactions tests-start] {"level":"info","time":1592003115414,"pid":26692,"hostname":"precision5510","msg":"OrderWatcherService sync complete","v":1}
two order submission
- price checking yields the correct market price
- the quote matches the price check
- submitting the quote is successful and money changes hands correctly
[meta transactions tests-start | error] Killed
[meta transactions tests-start | error] error Command failed with exit code 137.
[meta transactions tests-start] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
metrics tests
/metrics
✓ returns default prometheus metrics
✓ returns a custom metric correctly
serviceUtils test
getEstimatedGasTokenRefundInfo
✓ returns an estimate when there are gasTokens and bridge fills
✓ does not return an estimate when there are bridge fills but no gas tokens
✓ does not return an estimate when there are gas tokens but no bridge fills
Standard Relayer API (SRA) tests
/fee_recipients
✓ should return the list of fee recipients
/orders
✓ should return empty response when no orders
✓ should return orders in the local cache (70ms)
✓ should return orders filtered by query params (39ms)
✓ should return empty response when filtered by query params (45ms)
✓ should normalize addresses to lowercase
GET /order
✓ should return order by order hash
✓ should return 404 if order is not found
GET /asset_pairs
✓ should respond to GET request
GET /orderbook
✓ should return orderbook for a given pair
✓ should return empty response if no matching orders
✓ should return validation error if query params are missing
POST /order_config
✓ should return 200 on success
✓ should return informative error when missing fields
POST /order
✓ should return HTTP OK on success (230ms)
/swap
/quote
1) with INSUFFICIENT_ASSET_LIQUIDITY when there's no liquidity (empty orderbook, sampling excluded, no RFQ)
2) should respect buyAmount
3) should respect sellAmount
4) should respect gasPrice
5) should respect excludedSources
6) should return a Forwarder transaction for sellToken=ETH
7) should not throw a validation error if takerAddress can complete the quote
8) should throw a validation error if takerAddress cannot complete the quote
9) should not return estimatedGasTokenRefund: 0 if there are not gas tokens in our wallet
valid token parameter permutations
10) should return a valid quote with {"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1000"}
11) should return a valid quote with {"buyToken":"WETH","sellToken":"ZRX","buyAmount":"1000"}
12) should return a valid quote with {"buyToken":"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c","sellToken":"WETH","buyAmount":"1000"}
13) should return a valid quote with {"buyToken":"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c","sellToken":"0x0b1ba0af832d7c05fd64161e0db78e85978e8082","buyAmount":"1000"}
14) should return a valid quote with {"buyToken":"ZRX","sellToken":"0xbe0037eaf2d64fe5529bca93c18c9702d3930376","buyAmount":"1000"}
/tokens
15) should return a list of known tokens
/prices
16) should return accurate pricing
17) should respect the sellToken parameter
transaction watcher signer tests
.getSortedSignersByAvailability
✓ sorts signers in order of highest balance andd lowest tx count
tx lifecycle
- submits a transaction
- marks a transaction as dropped if it has been seen then disappears
- unsticks a stuck transaction
40 passing (5m)
7 pending
17 failing
1) /swap
/quote
with INSUFFICIENT_ASSET_LIQUIDITY when there's no liquidity (empty orderbook, sampling excluded, no RFQ):
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
2) /swap
/quote
should respect buyAmount:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
3) /swap
/quote
should respect sellAmount:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
4) /swap
/quote
should respect gasPrice:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
5) /swap
/quote
should respect excludedSources:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
6) /swap
/quote
should return a Forwarder transaction for sellToken=ETH:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
7) /swap
/quote
should not throw a validation error if takerAddress can complete the quote:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
8) /swap
/quote
should throw a validation error if takerAddress cannot complete the quote:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
9) /swap
/quote
should not return estimatedGasTokenRefund: 0 if there are not gas tokens in our wallet:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
10) /swap
/quote
valid token parameter permutations
should return a valid quote with {"buyToken":"ZRX","sellToken":"WETH","buyAmount":"1000"}:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
11) /swap
/quote
valid token parameter permutations
should return a valid quote with {"buyToken":"WETH","sellToken":"ZRX","buyAmount":"1000"}:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
12) /swap
/quote
valid token parameter permutations
should return a valid quote with {"buyToken":"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c","sellToken":"WETH","buyAmount":"1000"}:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
13) /swap
/quote
valid token parameter permutations
should return a valid quote with {"buyToken":"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c","sellToken":"0x0b1ba0af832d7c05fd64161e0db78e85978e8082","buyAmount":"1000"}:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
14) /swap
/quote
valid token parameter permutations
should return a valid quote with {"buyToken":"ZRX","sellToken":"0xbe0037eaf2d64fe5529bca93c18c9702d3930376","buyAmount":"1000"}:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at /home/gene/dev/0x-api/test/swap_test.ts:300:33
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
15) /swap
/tokens
should return a list of known tokens:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Object.<anonymous> (test/swap_test.ts:249:41)
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
16) /swap
/prices
should return accurate pricing:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Object.<anonymous> (test/swap_test.ts:260:41)
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
17) /swap
/prices
should respect the sellToken parameter:
AssertionError: expected 'text/html' to equal 'application/json'
+ expected - actual
-text/html
+application/json
at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1026:12)
at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
at Proxy.<anonymous> (node_modules/chai-bignumber/chai-bignumber.js:51:22)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:289:22)
at Proxy.<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:20)
at Proxy.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Assertion.<anonymous> (node_modules/dirty-chai/lib/dirty-chai.js:115:25)
at Assertion.overwritingMethodWrapper (node_modules/chai/lib/chai/utils/overwriteMethod.js:78:33)
at Object.<anonymous> (test/swap_test.ts:266:41)
at Generator.next (<anonymous>)
at fulfilled (lib/test/swap_test.js:4:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Command failed with exit code 17.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 17.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment