Skip to content
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

Attach signer information to tx(s) endpoints #152

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

enobayram
Copy link
Contributor

This PR adds the _txDetail_signers :: [Signer] field to the TxDetail served by the GET /txs/tx and GET /txs/txs endpoints.

Additionally:

  • It implements the necessary ToSchema types for the OAS3 spec.
  • Adds a schema migration that swaps the order of the primary key columns of the signers table so that the primary key index supports efficient signer lookups.

@@ -0,0 +1,2 @@
ALTER TABLE signers DROP CONSTRAINT signers_pkey;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also change the primary key in haskell-src/lib/ChainwebDb/Types/Signer.hs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funny enough, the Haskell code already looks like it's declaring the first column of the primary key to be requestkey:

primaryKey = SignerId <$> _signer_requestkey <*> _signer_idx

Seems like beam is being very haphazard here.

Copy link
Contributor

@emmanueldenloye emmanueldenloye left a comment

Choose a reason for hiding this comment

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

LGTM

@enobayram enobayram merged commit a815997 into master Jul 19, 2023
enobayram added a commit to kadena-io/chainweb-api that referenced this pull request Aug 1, 2023
This PR adds the signers list to the `TxDetail` type in order to support kadena-io/chainweb-data#152 which is a requirement for adding the signers information to the `txdetail` view of the block explorer.

* Add Signers list to TxDetail

* Add signatures to TxDetail
enobayram added a commit that referenced this pull request Aug 1, 2023
This PR is an amendment to #152, where we omitted the `sigs` field by oversight.

* Add sigs field to tx detail responses

* Bump CWA pin after merging API changes
enobayram added a commit to kadena-io/block-explorer that referenced this pull request Aug 1, 2023
This PR adds the "Signers" and "Signatures" fields to the `txdetail` view. These new fields display the new `TxDetails` fields of the `chainweb-data` API added by kadena-io/chainweb-data#152 and kadena-io/chainweb-data#153.

We used to have this information in the block transactions view before we redesigned that view to be a table of brief information about each transaction, each row linking to the corresponding `txdetail` page, losing the Signers and Signatures information in the process. This PR recovers these fields for the `block-explorer`.

* Add Signers and Signatures fields to txdetail view

* Remove Account and Scheme fields if they're empty

* Rename Account field to Address

* Separate the args of sig capabilities

* Let txDetailPage accept a NonEmpty list

* Rename txDetails

* Add separators to signatures
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.

2 participants