-
Notifications
You must be signed in to change notification settings - Fork 11
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
docs: add transaction types to enum #2091
base: master
Are you sure you want to change the base?
Conversation
docs/swagger_v3/contracts.spec.yaml
Outdated
@@ -21,7 +21,7 @@ schemas: | |||
source_tx_hash: | |||
$ref: '#/components/schemas/TransactionHash' | |||
source_tx_type: | |||
type: string | |||
$ref: '#/components/schemas/TransactionType' |
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 propose doing it more accurately by specifying only possible values. For example, a contract can't be created by a spend transaction.
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.
Oh I see. I'll look into it
@@ -141,3 +141,33 @@ components: | |||
required: | |||
- next | |||
- prev | |||
TransactionType: |
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.
is it possible to use something like $ref: '#/components/schemas/Tx/allOf/0/properties/type'
instead?
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 was looking for something like that. I'll use it
@@ -180,8 +180,7 @@ schemas: | |||
items: | |||
$ref: '#/components/schemas/Signature' | |||
tx: | |||
type: object | |||
# TODO: define properties | |||
$ref: '#/components/schemas/Tx' |
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.
As far as I know, it can be only name claim, contract call, contract deploy (?)
Doing as you propose, TypeScript will ask the developer to go over every transaction type (not necessary).
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.
So make it like the TransactionType should be and add only the possible ones?
resolves: #2082