Skip to content
Unverified Commit 555817c8 authored by Dominique's avatar Dominique Committed by GitHub
Browse files

feat: add decoded XCM data in `blocks` endpoint (#1364)



* feat: add decoded xcm data in blocks endpoint

* add types to fix any lint errors

* update copyright year

* fix paraId filter for horizontal msgs

* fix xcm decoding for moonbeam horizontal msg

* add yarn.lock file

* update docs

* removed moonbeam package

* adding back yarn.lock

* changed variable to const

* retrieved yarn.lock from master branch

* added a test for decoding upward msg in polkadot block

* added test for decoding horizontal msg in KAH block

* updated cacheKey with query params of decodedXcmMsgs and paraId
- updated docs in blocks controller comments

* replaced mocked data of block 18207445 with those of block 18468942
- in block 18468942 we have 2 upward msgs from two different parachains so with the same mocked data we can add 2 tests
- added a test to check the query param paraId is working as expected

* replaced mocked data of block 5831776 with those of block 3356195
- in block 3356195 we have downward and horizontal msgs so with the same mocked data we can test two different directions

* changed structure of decodedXcmMsgs response
- changed structure of the decodedMsgs response so that it always returns three arrays (filled or empty), one for each direction.
- removed an if statement as unnecessary in XCMDecoder
- updated corresponding tests with the new structure of the response

* reintroduced the if statement so that paraId query param works when connected to parachain

* added test to check if query param paraId works correctly also in horizontal msgs

* run linter

* added the decodedXcmMsgs response for blockId endpoint
- the response is a combination of Block and BlockXCM response with the use of allOf
- added schema for Liquidity Pool because the swagger was complaining
- changed the order of a hash field so that it aligns of it actually appears in the corresponding response

* added decodedXcmMsgsArg and paraId in the options arg

* added validation for paraId query param
- changed type of paraId after validation
- renamed boolean option for decodedXcmMsgs so it is shorter

* XCMDecoder changes from Tarik's Amazing review
- changes in imports
- replaced class name with the keyword 'this'
- replaced static with readonly for class properties
- replaced static with private for class methods
- changed specname to lowercase

* reused mockApi's 'perClass' in the other mocked apis
- added the 'type' keyword in more imports

* run linter & refix imports

* Update src/services/blocks/BlocksService.ts

Co-authored-by: default avatarTarik Gul <[email protected]>

* fix on the perClass field

---------

Co-authored-by: default avatarmarshacb <[email protected]>
Co-authored-by: default avatarTarik Gul <[email protected]>
parent 95987f55
Pipeline #437529 passed with stages
in 36 minutes and 14 seconds