graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

fix: returned string of BigInt.toHexString

Open fewwwww opened this issue 2 years ago • 1 comments

For The Graph's graph-ts implementation, BigInt.toHex() and BigInt.toHexString() behaves the same.

toHex(): string {
  return typeConversion.bigIntToHex(this);
}

toHexString(): string {
  return typeConversion.bigIntToHex(this);
}

However, in my thoughts toHex() should return a string that looks like deadbeef while toHexString() should return a string that looks like 0xdeadbeef.

So the implementation should be updated into:

toHex(): string {
  return typeConversion.bigIntToHex(this);
}

toHexString(): string {
  return "0x" + typeConversion.bigIntToHex(this);
}

Additionally, toHexString() is not tracked by The Graph's AssemblyScript API docs.

fewwwww avatar Jun 23 '23 22:06 fewwwww

⚠️ No Changeset found

Latest commit: 890385bfd4ce2e941463d3aa9e409cf9f0741a3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jun 23 '23 22:06 changeset-bot[bot]