Skip to content

Commit 1d4fb3f

Browse files
committed
Merge branch 'main' into 2025-01-touch-up-doc-comments
2 parents 57d2ce9 + 54d9a52 commit 1d4fb3f

File tree

5 files changed

+51
-13
lines changed

5 files changed

+51
-13
lines changed

.github/workflows/build-bindings.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,36 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15+
check-npm-deps:
16+
name: check-npm-deps
17+
runs-on: [sdk-self-hosted-linux-amd64-build-system]
18+
steps:
19+
- name: Set up Nix
20+
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
21+
- name: Disable smudging
22+
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
- name: Try to build
27+
run: |
28+
set -Eeu
29+
./pin.sh
30+
nix build o1js#npm-deps
31+
update-npm-deps:
32+
needs: check-npm-deps
33+
if: ${{ failure() }}
34+
runs-on: [sdk-self-hosted-linux-amd64-build-system]
35+
steps:
36+
- name: Set up Nix
37+
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
38+
- name: update-hash
39+
run: nix run o1js#update-npm-deps
40+
- uses: parkerbxyz/suggest-changes@v1
41+
with:
42+
comment: 'please update the npm-deps-hash'
43+
event: 'REQUEST_CHANGES'
44+
1545
nix-build:
1646
name: build-bindings-ubuntu
1747
runs-on: [sdk-self-hosted-linux-amd64-build-system]

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
5050
- Compiling stuck in the browser for recursive zkprograms https://github.com/o1-labs/o1js/pull/1906
5151
- Error message in `rangeCheck16` gadget https://github.com/o1-labs/o1js/pull/1920
5252
- Deprecate `testnet` `networkId` in favor of `devnet` https://github.com/o1-labs/o1js/pull/1938
53+
- Fix event data type inconsistency between LocalBlockchain and Mina https://github.com/o1-labs/o1js/pull/1975
5354

5455
## [2.1.0](https://github.com/o1-labs/o1js/compare/b04520d...e1bac02) - 2024-11-13
5556

flake.nix

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,12 @@
158158
./package-lock.json
159159
];
160160
});
161-
# If you see 'ERROR: npmDepsHash is out of date' in ci
162-
# set this to blank run ``nix build o1js#o1js-bindings`
163-
# If you don't want to install nix you can also set it to "" and run ci to get the new hash
164-
# You should get an output like this:
165-
166-
# error: hash mismatch in fixed-output derivation '/nix/store/a03cg2az0b2cvjsp1wnr89clf31i79c1-o1js-npm-deps.drv':
167-
# specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
168-
# got: sha256-8EPvXpOgn0nvm/pFKN3h6EMjabOeBqfy5optIfe8E8Q=
169-
# replace npmDepsHash bellow with the new hash
170-
171-
npmDepsHash = "sha256-QLnSfX6JwYQXyHGNSxXdzqbhkbFl67sDrmlW/F6D/pw=";
161+
# If you get ERROR: npmDepsHash is out of date
162+
# you can update the hash with `nix run o1js#update-npm-deps`.
163+
# Failing that you can remove the hash from ./npmDepsHash and try again
164+
# which should get an error message with the correct hash
165+
# You can also just push and CI should suggest a fix which updates the hash
166+
npmDepsHash = builtins.readFile ./npmDepsHash;
172167
# The prepack script runs the build script, which we'd rather do in the build phase.
173168
npmPackFlags = [ "--ignore-scripts" ];
174169
dontNpmBuild = true;
@@ -218,6 +213,7 @@
218213
# TODO build from ./ocaml root, not ./. (after fixing a bug in dune-nix)
219214
packages = {
220215
inherit dune-description;
216+
npm-deps = o1js-npm-deps;
221217
o1js-bindings = pkgs.stdenv.mkDerivation {
222218
name = "o1js_bindings";
223219
src = with pkgs.lib.fileset;
@@ -286,6 +282,16 @@
286282
ocaml-js = prj.pkgs.__ocaml-js__;
287283
};
288284
apps = {
285+
update-npm-deps = {
286+
type = "app";
287+
program = "${pkgs.writeShellApplication
288+
{ name = "update-npm-deps";
289+
text =
290+
''
291+
${pkgs.prefetch-npm-deps}/bin/prefetch-npm-deps ./package-lock.json > npmDepsHash
292+
'';
293+
}}/bin/update-npm-deps";
294+
};
289295
update-bindings = {
290296
type = "app";
291297
program = "${pkgs.writeShellApplication

npmDepsHash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sha256-hFxCHth04vW95DJCTLHKV2N0v9NNQG57DpucsAq3yvs=

src/lib/mina/local-blockchain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ async function LocalBlockchain({
236236
events[addr] ??= {};
237237
if (p.body.events.data.length > 0) {
238238
events[addr][tokenId] ??= [];
239-
let updatedEvents = p.body.events.data.map((data) => {
239+
let updatedEvents = p.body.events.data.map((data: Field[]) => {
240240
return {
241-
data,
241+
data: data.map(e => e.toString()),
242242
transactionInfo: {
243243
transactionHash: '',
244244
transactionStatus: '',

0 commit comments

Comments
 (0)