Skip to content

Conversation

@134dd3v
Copy link
Member

@134dd3v 134dd3v commented May 14, 2022

No description provided.

let observation = new FundingObservation(observationId);
observation.pool = pool.id;
observation.timestamp = timestamp;
observation.fundingRate = getFundingRate(BigInt.fromString(pool.id));
Copy link
Member Author

Choose a reason for hiding this comment

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

Can you review if converting hex string to BigInt here is correct?

Copy link
Member

Choose a reason for hiding this comment

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

BigInt.fromString(pool.id) not enough confidence in this one.
You can try -

let bytes = ByteArray.fromHexString(hexString)
let poolIdBigInt. = BigInt.fromSignedBytes(bytes)

But I don't like that too much either, why can't you access the BigInt version of poolId from the event?

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