merkle-heap-snarkyjs
Version:
Implementation of a Merkle Heap for SnarkyJS, a framework to develop ZK-snarks on Mina Protocol.
58 lines (48 loc) • 1.04 kB
text/typescript
export {};
import { MerkleHeap } from "./MerkleHeap.js";
import {
matrixProp,
CircuitValue,
Field,
SmartContract,
PublicKey,
method,
PrivateKey,
Mina,
state,
State,
isReady,
Poseidon,
AccountUpdate,
Bool,
Experimental,
Circuit,
DeployArgs,
Permissions,
UInt64,
Int64,
MerkleTree,
Signature,
} from 'snarkyjs';
await isReady;
const heap = new MerkleHeap(3);
export class MerkleHeapDemo extends SmartContract{
(Field) firstInsertion = State <Field>;
//Iniate the heap with 1 insertion
initState (initialValue:Field){
heap.insert(initialValue)
//Check if the min is equal to the initial value as it is just one
let test= heap.findMin()
console.log('TEST', test?.toBigInt())
}
fillHeap (height:Number){
h
}
insertValue(value:Field){
heap.insert(value)
}
deleteValue(valueToDelete:Field){
}
deleteMin(){
}
}