Skip to content

Marketplace: load service on demand#897

Merged
NicolasMahe merged 4 commits intodevfrom
ss/marketplace-service-ondemand-loading
Apr 23, 2019
Merged

Marketplace: load service on demand#897
NicolasMahe merged 4 commits intodevfrom
ss/marketplace-service-ondemand-loading

Conversation

@NicolasMahe
Copy link
Copy Markdown
Member

@NicolasMahe NicolasMahe commented Apr 18, 2019

Dependant on #896

This pr change the way service's versions, offers and purchases are fetched.
Before, getting a service also fetch everything.
Now, the child-data needs to be explicitly fetched.

Task getService still returns the same payload, but task listService only returns the "basic" service data: sid, owner and createTime.

TODO:

@NicolasMahe NicolasMahe force-pushed the ss/marketplace-service-ondemand-loading branch 5 times, most recently from 0c4b618 to d96c243 Compare April 23, 2019 04:16
@NicolasMahe NicolasMahe force-pushed the ss/marketplace-service-ondemand-loading branch from d96c243 to 8b7a8e5 Compare April 23, 2019 04:17
@NicolasMahe
Copy link
Copy Markdown
Member Author

@mesg-foundation/core ready for review

Copy link
Copy Markdown
Member

@antho1404 antho1404 left a comment

Choose a reason for hiding this comment

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

Compilation issue while building the docker image

src/tasks/prepareCreateServiceOffer.ts(24,35): error TS2339: Property 'versions' does not exist on type 'Service'.
src/tasks/preparePurchase.ts(25,111): error TS2339: Property 'offers' does not exist on type 'Service'.
src/tasks/preparePurchase.ts(26,27): error TS2339: Property 'offers' does not exist on type 'Service'.

@NicolasMahe
Copy link
Copy Markdown
Member Author

Compilation issue while building the docker image

src/tasks/prepareCreateServiceOffer.ts(24,35): error TS2339: Property 'versions' does not exist on type 'Service'.
src/tasks/preparePurchase.ts(25,111): error TS2339: Property 'offers' does not exist on type 'Service'.
src/tasks/preparePurchase.ts(26,27): error TS2339: Property 'offers' does not exist on type 'Service'.

It's fixed now. please review


// get offer data
const offerIndex = new BigNumber(inputs.offerIndex)
assert.ok(offerIndex.isInteger() && offerIndex.isGreaterThanOrEqualTo(0) && offerIndex.isLessThan(service.offers.length), 'offer index is out of range')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A similar test is done in getServiceOffer.

Copy link
Copy Markdown
Member

@antho1404 antho1404 left a comment

Choose a reason for hiding this comment

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

Ok for me, I got a lot of errors when getting the manifest, either with a timeout or not a valid manifest but I guess because we changed the node and the data structure. We really need a fresh marketplace to test correctly :)

@NicolasMahe NicolasMahe merged commit b6c946e into dev Apr 23, 2019
@NicolasMahe NicolasMahe deleted the ss/marketplace-service-ondemand-loading branch April 23, 2019 08:25
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.

3 participants