Skip to content

Commit

Permalink
Merge pull request #1402 from o1-labs/refactor/account-update-trees
Browse files Browse the repository at this point in the history
Remove children from AccountUpdate: RFC and Implementation
  • Loading branch information
mitschabaude authored Feb 13, 2024
2 parents baac0cb + 24475dd commit 9d43f86
Show file tree
Hide file tree
Showing 25 changed files with 963 additions and 756 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/live-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
main-branch:
timeout-minutes: 25
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main')
services:
Expand All @@ -40,7 +40,7 @@ jobs:
mina-branch-name: o1js-main

berkeley-branch:
timeout-minutes: 25
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/berkeley' || (github.event_name == 'pull_request' && github.base_ref == 'berkeley')
services:
Expand All @@ -66,7 +66,7 @@ jobs:
mina-branch-name: berkeley

develop-branch:
timeout-minutes: 25
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || (github.event_name == 'pull_request' && github.base_ref == 'develop')
services:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased](https://github.com/o1-labs/o1js/compare/834a44002...HEAD)

### Breaking changes

- Remove `AccountUpdate.children` and `AccountUpdate.parent` properties https://github.com/o1-labs/o1js/pull/1402
- Also removes the optional `AccountUpdatesLayout` argument to `approve()`
- Adds `AccountUpdateTree` and `AccountUpdateForest`, new classes that represent a layout of account updates explicitly
- Both of the new types are now accepted as inputs to `approve()`
- `accountUpdate.extractTree()` to obtain the tree associated with an account update in the current transaction context.

### Added

- `MerkleList<T>` to enable provable operations on a dynamically-sized list https://github.com/o1-labs/o1js/pull/1398
Expand Down
6 changes: 2 additions & 4 deletions src/examples/zkapps/token_with_proofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ class TokenContract extends SmartContract {
receiverAddress: PublicKey,
callback: Experimental.Callback<any>
) {
let senderAccountUpdate = this.approve(
callback,
AccountUpdate.Layout.AnyChildren
);
// TODO use token contract methods for approve
let senderAccountUpdate = this.approve(callback) as AccountUpdate;
let amount = UInt64.from(1_000);
let negativeAmount = Int64.fromObject(
senderAccountUpdate.body.balanceChange
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export {
ZkappPublicInput,
TransactionVersion,
AccountUpdateForest,
AccountUpdateTree,
} from './lib/account_update.js';

export { TokenAccountUpdateIterator } from './lib/mina/token/forest-iterator.js';
Expand Down
Loading

0 comments on commit 9d43f86

Please sign in to comment.