nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: onflow/fcl-js
Pull request #1008 (2022-02-04 22:17:35)

PKG -- [transport-http] VSN 0.0.4 -> 0.0.5
PKG -- [transport-http] VSN 0.0.4 -> 0.0.5


Patch:
diff --git a/packages/transport-http/CHANGELOG.md b/packages/transport-http/CHANGELOG.md
index bf13a12a..76df3ad4 100644
--- a/packages/transport-http/CHANGELOG.md
+++ b/packages/transport-http/CHANGELOG.md
@@ -1,3 +1,7 @@
+### 0.0.5 -- 2022-02-04
+
+- 2022-02-04 -- Decodes event payloads from base64
+
 ### 0.0.3 -- 2022-02-02
 
 - 2022-02-03 -- Adds statusCode placeholder to get transaction status response.
diff --git a/packages/transport-http/package-lock.json b/packages/transport-http/package-lock.json
index 1efadb75..7d0fa571 100644
--- a/packages/transport-http/package-lock.json
+++ b/packages/transport-http/package-lock.json
@@ -1,12 +1,12 @@
 {
     "name": "@onflow/transport-http",
-    "version": "0.0.4-alpha.0",
+    "version": "0.0.5",
     "lockfileVersion": 2,
     "requires": true,
     "packages": {
         "": {
             "name": "@onflow/transport-http",
-            "version": "0.0.3",
+            "version": "0.0.5",
             "license": "Apache-2.0",
             "dependencies": {
                 "@onflow/util-address": "^0.0.0",
diff --git a/packages/transport-http/package.json b/packages/transport-http/package.json
index 54c9a993..a54770de 100644
--- a/packages/transport-http/package.json
+++ b/packages/transport-http/package.json
@@ -1,6 +1,6 @@
 {
     "name": "@onflow/transport-http",
-    "version": "0.0.4-alpha.0",
+    "version": "0.0.5",
     "description": "Flow SDK HTTP Transport Module",
     "license": "Apache-2.0",
     "author": "Dapper Labs <dev@dapperlabs.com>",
diff --git a/packages/transport-http/src/send-get-transaction-status.js b/packages/transport-http/src/send-get-transaction-status.js
index 0b7a343c..0c93bd91 100644
--- a/packages/transport-http/src/send-get-transaction-status.js
+++ b/packages/transport-http/src/send-get-transaction-status.js
@@ -37,7 +37,7 @@ export async function sendGetTransactionStatus(ix, context = {}, opts = {}) {
       transactionId: event.transaction_id,
       transactionIndex: Number(event.transaction_index),
       eventIndex: Number(event.event_index),
-      payload: event.payload
+      payload: JSON.parse(Buffer.from(event.payload, "base64").toString())
     }))
   }
 


Test patch:
diff --git a/packages/transport-http/src/send-get-transaction-status.test.js b/packages/transport-http/src/send-get-transaction-status.test.js
index af03e95b..0104d860 100644
--- a/packages/transport-http/src/send-get-transaction-status.test.js
+++ b/packages/transport-http/src/send-get-transaction-status.test.js
@@ -19,7 +19,7 @@ describe("Get Transaction Status", () => {
                 transaction_id: "a1b2c3",
                 transaction_index: "123",
                 event_index: "456",
-                payload: {type: "String", value: "Hello, Flow"}
+                payload: Buffer.from(JSON.stringify({type: "String", value: "Hello, Flow"})).toString("base64")
             }
         ]
     }
Repository: onflow/fcl-js
Pull request #1234 (2022-06-07 12:48:00)

[Types] Extend decimal places for UFix64 and Fix64
This PR makes sure the UFix64 and Fix64 are always extended to include 8 decimal places, that is done in order to ensure output that is unified with how Cadence Go implementation formats the Fix numbers. 

This also closes the issue: https://github.com/onflow/cadence/issues/1652

changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: b895e313164bbd665b6f6e1dea771486d5f5648a

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.**

<details><summary>This PR includes no changesets</summary>

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

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/onflow/fcl-js/new/encode/number-precission?filename=.changeset/perfect-monkeys-try.md&value=---%0A%22%40onflow%2Ftypes%22%3A%20patch%0A---%0A%0A%5BTypes%5D%20Extend%20decimal%20places%20for%20UFix64%20and%20Fix64%0A)



Patch:
diff --git a/packages/types/src/types.js b/packages/types/src/types.js
index 8109bf64..d74d1787 100644
--- a/packages/types/src/types.js
+++ b/packages/types/src/types.js
@@ -451,6 +451,10 @@ export const UFix64 = type(
         )
       }
 
+      // make sure the number is extended to 8 decimal places so it matches cadence encoding of UFix values
+      vParts[1] = vParts[1].padEnd(8, '0')
+      v = vParts.join(".")
+
       return {
         type: "UFix64",
         value: v,
@@ -483,6 +487,10 @@ export const Fix64 = type(
         )
       }
 
+      // make sure the number is extended to 8 decimal places so it matches cadence encoding of Fix64 values
+      vParts[1] = vParts[1].padEnd(8, '0')
+      v = vParts.join(".")
+
       return {
         type: "Fix64",
         value: v,


Test patch:
diff --git a/packages/types/src/types.test.js b/packages/types/src/types.test.js
index ccea19f3..1480c165 100644
--- a/packages/types/src/types.test.js
+++ b/packages/types/src/types.test.js
@@ -37,8 +37,8 @@ import * as t from "./types.js"
     "64.000000001",
     true,
   ],
-  [t.UFix64, "64.0", {type: "UFix64", value: "64.0"}, "64.0", false],
-  [t.Fix64, "64.0", {type: "Fix64", value: "64.0"}, "64.0", false],
+  [t.UFix64, "64.0", {type: "UFix64", value: "64.00000000"}, "64.0", false],
+  [t.Fix64, "64.0", {type: "Fix64", value: "64.00000000"}, "64.0", false],
   [
     t.String,
     "Go with the Flow",