-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: implement /v1/blocks/{hash_or_height}
endpoint
#42
Conversation
Vercel deployment URL: https://signer-metrics-k6smqst84-hirosystems.vercel.app 🚀 |
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
test('get block by latest', async () => { | ||
// Note: the current block payload test data does not have signer data for the latest block | ||
const expectedBlockData: BlocksEntry = { | ||
block_height: 112291, | ||
block_hash: '0x82ac0b52a4dde86ac05d04f59d81081d047125d0c7eaf424683191fc3fd839f2', | ||
block_time: 1730554958, | ||
index_block_hash: '0x7183de5c4ae700248283fede9264d31a37ab3ca1b54b4fd24adc449fbbd4c2b7', | ||
burn_block_height: 65206, | ||
tenure_height: 53408, | ||
}; | ||
|
||
const { body: testBlockLatest } = (await supertest(apiServer.server) | ||
.get(`/signer-metrics/v1/blocks/latest`) | ||
.expect(200)) as { body: BlocksEntry }; | ||
expect(testBlockLatest).toEqual(expectedBlockData); | ||
}); |
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.
If a given block doesn't have signer metric data then no signer related information is returned. It should be possible to at least return the expected number of signers (from the cycle reward set), and number of accepted signers (number of signatures in the block).
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.
👍🏻
## [0.7.0](v0.6.0...v0.7.0) (2024-11-08) ### Features * implement `/v1/blocks/{hash_or_height}` endpoint ([#42](#42)) ([3ec299e](3ec299e))
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #25
Implement
/v1/blocks/{hash_or_height}
endpoint.Can also take a
latest
argGET /v1/blocks/latest