Skip to content

docs: add tx types to transactions_spec.yaml #2119

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yaboiishere
Copy link
Contributor

@yaboiishere yaboiishere commented Mar 13, 2025

Added the missing fields in the swagger for transactions and added the ttl field to the transactions as in the docs

resolves: #2115

@yaboiishere yaboiishere self-assigned this Mar 13, 2025
@@ -1,4 +1,30 @@
schemas:
ChannelId:
type: string
example: ch_2VfzXmCRZepB3ichPf3WTt2uf8zMqsyY3cZWg8k1vt3xcu8L8V
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
example: ch_2VfzXmCRZepB3ichPf3WTt2uf8zMqsyY3cZWg8k1vt3xcu8L8V
pattern: ^ch_\w{38,50}$
example: ch_2VfzXmCRZepB3ichPf3WTt2uf8zMqsyY3cZWg8k1vt3xcu8L8V

so SDK can know that it is ch_-prefixed

Comment on lines 16 to 27
type: object
required:
- responder_id
- initiator_id
- round
properties:
initiator_id:
$ref: '#/components/schemas/AccountAddress'
responder_id:
$ref: '#/components/schemas/AccountAddress'
round:
type: integer
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type: object
required:
- responder_id
- initiator_id
- round
properties:
initiator_id:
$ref: '#/components/schemas/AccountAddress'
responder_id:
$ref: '#/components/schemas/AccountAddress'
round:
type: integer
allOf:
- '#/components/schemas/ChannelResponderInitiator'
- type: object
required:
- round
properties:
round:
type: integer

properties:
aexn_type:
type: string
example: aex9
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
example: aex9
example: aex9
enum:
- aex9

type: array
items:
type: object
properties:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
properties:
required:
- type
- value
properties:

type: array
items:
type: object
properties:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
properties:
required:
- address
- data
- topics
properties:

Comment on lines +63 to +67
- args
- auth_fun_name
- contract_id
- gas_used
- return_type
Copy link
Member

Choose a reason for hiding this comment

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

the only auth_fun_name is not defined in MdwContractCreateExtras

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you elaborate this, I don't think I understood you

Copy link
Member

Choose a reason for hiding this comment

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

I meant to reuse some of the contract definitions, but maybe it isn't worth it 🤷‍♀️

gas_used:
type: integer
return_type:
type: string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type: string
type: string
enum:
- ok

gas_used:
type: integer
return_type:
type: string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type: string
type: string
enum:
- ok

Comment on lines +86 to +87
- gas_used
- return_type
Copy link
Member

Choose a reason for hiding this comment

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

also a duplicate definition

Comment on lines 164 to 166
required:
- type
type: object
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
required:
- type
type: object

type already marked as required at line 7 🤔

@yaboiishere yaboiishere requested a review from davidyuk March 19, 2025 06:40
- aexn_type
- gas_used
- return_type
- ttl
Copy link
Member

Choose a reason for hiding this comment

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

Don't mess with ttl, just preserve the node behaviour and types

- "topic2"
result:
type: string
example: ok
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it also an ok | revert | error enum?

Comment on lines +63 to +67
- args
- auth_fun_name
- contract_id
- gas_used
- return_type
Copy link
Member

Choose a reason for hiding this comment

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

I meant to reuse some of the contract definitions, but maybe it isn't worth it 🤷‍♀️

enum:
- ok
- error
- revert
Copy link
Member

Choose a reason for hiding this comment

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

contract create can't be reverted as I know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition of /transactions/{hash} lacks certain properties depending on the transaction type
2 participants