Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unsed static creators #98

Merged
merged 1 commit into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/zkapps/advanced-snarkyjs/merkle-tree.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Leaderboard extends SmartContract {
path.calculateRoot(account.hash()).assertEquals(root);

// we check that the account has at least 10 score points in order to claim the reward
account.score.assertGte(UInt32.fromNumber(10));
account.score.assertGte(UInt32.from(10));
jasongitmail marked this conversation as resolved.
Show resolved Hide resolved

// finally, we send the player a reward
this.send({
Expand Down Expand Up @@ -177,7 +177,7 @@ const Tree = new Experimental.MerkleTree(treeHeight);
class MerkleWitness extends Experimental.MerkleWitness(treeHeight) {}

// sets a value at position 0n
Tree.setLeaf(0n, Field.fromNumber(123));
Tree.setLeaf(0n, Field(123));

// gets the current root of the tree
const root = Tree.getRoot();
Expand All @@ -189,7 +189,7 @@ const witness = Tree.getWitness(0n);
const circuitWitness = new MerkleWitness(witness);

// calculates the root of the witness
const calculatedRoot = circuitWitness.calculateRoot(Field.fromNumber(123));
const calculatedRoot = circuitWitness.calculateRoot(Field(123));

calculatedRoot.assertEquals(root);
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zkapps/snarkyjs-reference/classes/AccountUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Constrain a property to lie between lower and upper bounds.
| :------ | :------ | :------ |
| `property` | `OrIgnore`<`ClosedInterval`<`T`\>\> | The property to constrain |
| `lower` | `T` | The lower bound |
| `upper` | `T` | The upper bound Example: To constrain the account balance of a SmartContract to lie between 0 and 20 MINA, you can use ```ts @method onlyRunsWhenBalanceIsLow() { let lower = UInt64.zero; let upper = UInt64.fromNumber(20e9); AccountUpdate.assertBetween(this.self.body.preconditions.account.balance, lower, upper); // ... } ``` |
| `upper` | `T` | The upper bound Example: To constrain the account balance of a SmartContract to lie between 0 and 20 MINA, you can use ```ts @method onlyRunsWhenBalanceIsLow() { let lower = UInt64.zero; let upper = UInt64.from(20e9); AccountUpdate.assertBetween(this.self.body.preconditions.account.balance, lower, upper); // ... } ``` |

#### Returns

Expand Down