ocean-subgraph icon indicating copy to clipboard operation
ocean-subgraph copied to clipboard

Change type of `lastPriceToken` from string to Token

Open mihaisc opened this issue 2 years ago • 6 comments

On Order , lastPriceToken should be Token

mihaisc avatar May 31 '22 08:05 mihaisc

I changed it back to string as it was causing problems: https://github.com/oceanprotocol/ocean-subgraph/pull/477

Will do another PR for this with more testing.

jamiehewitt15 avatar Jun 30 '22 10:06 jamiehewitt15

we need to make sure the Token exists, so when assigning a value to lastPriceToken we need to do a getToken. This function automatically created the token if not existing.

mihaisc avatar Jun 30 '22 12:06 mihaisc

so when assigning a value to lastPriceToken we need to do a getToken

From what I can see we already call getToken() before updating the lastPriceToken in handleOrderStarted. https://github.com/oceanprotocol/ocean-subgraph/blob/5da91c228211544fc76f26e3cb7df1884a274b21/src/mappings/erc20Templates.ts#L39

Are you referring to a different function?

jamiehewitt15 avatar Jul 05 '22 16:07 jamiehewitt15

That should be it. Then we need to debug what is not working.

mihaisc avatar Jul 06 '22 09:07 mihaisc

On Order , lastPriceToken should be Token

Why only on Order? lastPriceToken in Token is string, I'm not sure why they would be different?

jamiehewitt15 avatar Jul 08 '22 17:07 jamiehewitt15

They shouldn't , we just missed it

mihaisc avatar Jul 08 '22 18:07 mihaisc