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

feat: add clone function #165 #173

Merged
merged 1 commit into from
Oct 18, 2023
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
2 changes: 1 addition & 1 deletion examples/merkle/MerkleTreeClient.ts

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions examples/merkle/artifacts/MerkleTree.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ for_1:

// if0_condition
// examples/merkle/merkle.algo.ts:42
// this.isRightSibling(elem)
// this.isRightSibling(clone(elem))
frame_dig -2 // path: byte[33][3]
store 0 // full array
int 0 // initial offset
Expand All @@ -123,7 +123,7 @@ for_1:

// if0_consequent
// examples/merkle/merkle.algo.ts:43
// result = this.hashConcat(result, extract3(elem, 1, 32))
// result = this.hashConcat(clone(result), extract3(elem, 1, 32))
frame_dig -2 // path: byte[33][3]
store 0 // full array
int 0 // initial offset
Expand All @@ -143,7 +143,7 @@ for_1:

if0_else:
// examples/merkle/merkle.algo.ts:45
// result = this.hashConcat(extract3(elem, 1, 32), result)
// result = this.hashConcat(extract3(elem, 1, 32), clone(result))
frame_dig -1 // leaf: byte[32]
frame_dig -2 // path: byte[33][3]
store 0 // full array
Expand Down Expand Up @@ -237,7 +237,7 @@ verify:
proto 2 0

// examples/merkle/merkle.algo.ts:61
// assert(this.root.value === this.calcRoot(sha256(data), path))
// assert(this.root.value === this.calcRoot(sha256(data), clone(path)))
byte 0x726f6f74 // "root"
app_global_get
byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables
Expand Down Expand Up @@ -279,7 +279,7 @@ appendLeaf:
assert

// examples/merkle/merkle.algo.ts:66
// assert(this.root.value === this.calcRoot(EMPTY_HASH, path))
// assert(this.root.value === this.calcRoot(EMPTY_HASH, clone(path)))
byte 0x726f6f74 // "root"
app_global_get
byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables
Expand All @@ -293,7 +293,7 @@ appendLeaf:
assert

// examples/merkle/merkle.algo.ts:68
// this.root.value = this.calcRoot(sha256(data), path)
// this.root.value = this.calcRoot(sha256(data), clone(path))
byte 0x726f6f74 // "root"
byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables
frame_dig -2 // path: byte[33][3]
Expand Down Expand Up @@ -346,7 +346,7 @@ updateLeaf:
assert

// examples/merkle/merkle.algo.ts:75
// assert(this.root.value === this.calcRoot(sha256(oldData), path))
// assert(this.root.value === this.calcRoot(sha256(oldData), clone(path)))
byte 0x726f6f74 // "root"
app_global_get
byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables
Expand All @@ -358,7 +358,7 @@ updateLeaf:
assert

// examples/merkle/merkle.algo.ts:77
// this.root.value = this.calcRoot(sha256(newData), path)
// this.root.value = this.calcRoot(sha256(newData), clone(path))
byte 0x726f6f74 // "root"
byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables
frame_dig -3 // path: byte[33][3]
Expand Down
2 changes: 1 addition & 1 deletion examples/merkle/artifacts/MerkleTree.json

Large diffs are not rendered by default.

Loading