Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Rename fields in taker request#5

Merged
feuGeneA merged 11 commits intomasterfrom
feat/rename-indicative-quote-params
Jun 19, 2020
Merged

Rename fields in taker request#5
feuGeneA merged 11 commits intomasterfrom
feat/rename-indicative-quote-params

Conversation

@feuGeneA
Copy link
Copy Markdown
Contributor

@feuGeneA feuGeneA commented May 14, 2020

In lieu of CI, a log of a test run on the latest commit:

14May17:56:34 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params=]$ git log -1
commit 4d16e888ae43b292dc02f91f670006217627ed41
Author: F. Eugene Aumson <feuGeneA@users.noreply.github.com>
Date:   Thu May 14 17:56:24 2020 -0400

    Add .prettierignore file
14May17:56:37 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params=]$ git status
On branch feat/rename-indicative-quote-params
Your branch is up-to-date with 'origin/feat/rename-indicative-quote-params'.
nothing to commit, working tree clean
14May17:56:39 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params=]$ yarn clean && yarn build && yarn test && yarn lint
yarn run v1.19.1
$ shx rm -rf lib
Done in 0.13s.
yarn run v1.19.1
$ tsc -b
Done in 2.33s.
yarn run v1.19.1
$ NODE_ENV=test mocha --require source-map-support/register --require make-promises-safe ./lib/test/**/**/*_test.js --exit


  api key handler
    ✓ reject when canMakerControlSettlement == false & no API key specified
    ✓ accept when canMakerControlSettlement == false & API Key specified
    ✓ accept when canMakerControlSettlement == true & no API Key specified
    ✓ accept when canMakerControlSettlement == true & API Key specified

  taker request handler
    ✓ should defer to quoter and return response for firm quote
    ✓ should succeed without an API key if `canMakerControlSettlement` is set to `true` when requesting a firm quote
    ✓ should defer to quoter and return response for indicative quote
    ✓ should handle empty indicative quote
    ✓ should handle empty firm quote
    ✓ should invalidate a bad request

  submit request handler
    ✓ should defer to quoter and return response for submit request
    ✓ should succeed without an API key when submitting a fill
    ✓ should invalidate a bad request
    ✓ should handle empty indicative quote


  14 passing (121ms)

Done in 0.62s.
yarn run v1.19.1
$ run-p tslint prettier:lint
$ tslint --format stylish --project .
$ yarn prettier --list-different
$ prettier '**/*.{ts,tsx,json,md}' --config .prettierrc --list-different
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
Done in 3.50s.

feuGeneA added a commit to 0xProject/0x-monorepo that referenced this pull request May 15, 2020
Unpin upon merge and republication of 0xProject/quote-server#5
@feuGeneA feuGeneA changed the title Rename fields in taker indicative quote request Rename fields in taker request May 15, 2020
CHANGELOG.json Outdated
@@ -0,0 +1,20 @@
[
{
"version": "0.1.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sup w/ these duplicate entries?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 598b8f9

Copy link
Copy Markdown
Contributor

@steveklebanoff steveklebanoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments but otherwise LGTM -- nice work

"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
"tslint": "tslint --format stylish --project .",
"tslint:fix": "yarn tslint --fix",
"prettier": "prettier '**/*.{ts,tsx,json,md}' --config .prettierrc",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we've had this convo before, but I personally would like to keep our script patterns the same as the monorepo.

If you feel strongly about grouping prettier & tslint into one "lint" command I see your point, but I do think it is a bit strange to have different patterns between this repo & the monorepo

Copy link
Copy Markdown
Contributor Author

@feuGeneA feuGeneA May 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your effort to keep us consistent. FYI I'm on a crusade to do this everywhere now. Every time I work in a monorepo package I'm updating it to include prettier in lint. Though, so far I've only done it to asset-swapper and migrations :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙀

feuGeneA added 2 commits May 20, 2020 12:50
I forgot to update the version number and changes in a recent commit.
@feuGeneA feuGeneA requested a review from steveklebanoff May 20, 2020 22:26
CHANGELOG.json Outdated
@@ -0,0 +1,29 @@
[
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this CHANGELOG.json actually do anything? I was expecting a publish entry in scripts to investigate, but I don't see one 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's just me keeping a manual record. Having it actually do something would be great, but I figured doing things manually would be better than doing nothing at all.

Copy link
Copy Markdown
Contributor

@steveklebanoff steveklebanoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about CHANGELOG.json and the absence of a publish script but LGTM regardless

feuGeneA added 3 commits May 21, 2020 12:47
21May12:46:46 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ git log -1
commit 6f94cfd1b9f8f50fdb61ead4f498f567dd268b8e
Author: F. Eugene Aumson <feuGeneA@users.noreply.github.com>
Date:   Thu May 21 12:45:31 2020 -0400

    Migrate CHANGELOG from .json to .md
21May12:46:47 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ git status
On branch feat/rename-indicative-quote-params
Your branch is ahead of 'origin/feat/rename-indicative-quote-params' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean
21May12:46:53 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ yarn lint
yarn run v1.19.1
$ run-p tslint prettier:lint
$ tslint --format stylish --project .
$ yarn prettier --list-different
$ prettier '**/*.{ts,tsx,json,md}' --config .prettierrc --list-different
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
Done in 3.12s.
That is, from devDependencies to regular dependencies.

This is needed because we export an interface (serverRoutes()) that
depends on those types.  Without this change, the monorepo's
`test-publish`, running with an asset-swapper modified to depend on this
package, gave:

node_modules/@0x/quote-server/lib/src/router.d.ts:2:70 - error TS2307: Cannot find module 'express-serve-static-core'.

2 export declare const serverRoutes: (quoteStrategy: Quoter) => import("express-serve-static-core").Router;
                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~

("express-serve-static-core" is a direct dependency of @types/express.)
@feuGeneA feuGeneA force-pushed the feat/rename-indicative-quote-params branch from 81f968d to ccf3819 Compare May 28, 2020 22:10
Clean test run:

28May18:01:47 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ git status
On branch feat/rename-indicative-quote-params
Your branch is ahead of 'origin/feat/rename-indicative-quote-params' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean
28May18:01:49 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ git log -1
commit 6bce4da342c3369c67e990d583b2add8a04a9978
Author: F. Eugene Aumson <feuGeneA@users.noreply.github.com>
Date:   Wed May 27 18:33:18 2020 -0400

    Add distinctive types for RFQM requests
28May18:01:53 [2 jobs] ~/dev/quote-server[feat/rename-indicative-quote-params>]$ btl
yarn run v1.19.1
$ tsc -b
Done in 0.35s.
yarn run v1.19.1
$ NODE_ENV=test mocha --require source-map-support/register --require make-promises-safe ./lib/test/**/**/*_test.js --exit

  api key handler
    ✓ reject when canMakerControlSettlement == false & no API key specified
    ✓ accept when canMakerControlSettlement == false & API Key specified
    ✓ accept when canMakerControlSettlement == true & no API Key specified
    ✓ accept when canMakerControlSettlement == true & API Key specified

  taker request handler
    ✓ should defer to quoter and return response for firm quote (41ms)
    ✓ should succeed without an API key if `canMakerControlSettlement` is set to `true` when requesting a firm quote
    ✓ should defer to quoter and return response for indicative quote
    ✓ should handle empty indicative quote
    ✓ should handle empty firm quote
    ✓ should invalidate a bad request

  submit request handler
    ✓ should defer to quoter and return response for submit request
    ✓ should succeed without an API key when submitting a fill
    ✓ should invalidate a bad request
    ✓ should handle empty indicative quote

  14 passing (166ms)

Done in 0.77s.
yarn run v1.19.1
$ run-p tslint prettier:lint
$ yarn prettier --list-different
$ tslint --format stylish --project .
$ prettier '**/*.{ts,tsx,json,md}' --config .prettierrc --list-different
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
Done in 4.35s.
@feuGeneA feuGeneA force-pushed the feat/rename-indicative-quote-params branch from ccf3819 to 37f5d6c Compare May 28, 2020 22:18
quoteExpiry: number;
}

export type FirmQuote = RFQTFirmQuote | RFQMFirmQuote;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants