-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaffold accounts service with connector #6
Conversation
b0a8827
to
d57768e
Compare
This will be extended by the accounts service.
Pass accounts service to connector.
d57768e
to
b8d7a3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we'll be testing against a pre-populated database. No problem with that! However, will there also be test hooks to dynamically create and cleanup accounts and transactions? Seeing it's a new project, maybe add this functionality from the beginning?
Not a blocking comment. Just an observation. Feel free to ignore/resolve.
export type AppContainer = IocContract<AppServices> | ||
|
||
export class App { | ||
private koa!: Koa<DefaultState, AppContext> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using non-null assertions + boot()
, I suggest having an async "constructor" (a static method on App
that returns a Promise<App>
). The synchronous parts of the constructor can be relegated to the actual (private) constructor
, which the static method would call when its done with its async setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
public disabled!: boolean | ||
|
||
public assetCode!: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why assetCode!:
and not assetCode:
(likewise for the other fields)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got this error without it and used the backend's models as guidance
error TS2564: Property 'assetCode' has no initializer and is not definitely assigned in the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I guess that's because BaseModel
defines the constructor.
@@ -4,4 +4,3 @@ export * from './logger' | |||
export * from './peers' | |||
export * from './router' | |||
export * from './tokens' | |||
export * from './accounts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a duplicate of line 1.
928c2b0
to
7faa0d3
Compare
7faa0d3
to
d4adcb2
Compare
@sethalicious I plan on wiping the db after each accounts service test (like here). Is that what you have in mind? I'm not sure if the tigerbeetle client currently supports resetting the db, so that may require some workarounds in the tests in the short term. |
No, Im not referring to wiping the db. Actually have hooks like "POST /createTestAccount", "POST deleteTestAccount", "POST clearTransactions". That way we can set up (and clean up) scenarios from the test instead of having to have a pre-populated database. Let the tests create the data and accounts via API calls. |
I'm not sure if we should do this at the API layer for the client or via the |
No description provided.