Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pindaroso committed Oct 13, 2024
1 parent ffb0b08 commit 0ad268a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
32 changes: 8 additions & 24 deletions packages/app/src/components/buttons/create-counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,21 @@ export const CreateButton: FC = () => {
try {
// TODO: Adapt for devnet, testnet and mainnet
const rpc = createRpc()
const { merkleTree, nullifierQueue, addressTree, addressQueue } =
defaultTestStateTreeAccounts()
//await compress(rpc, wallet, 1e9, publicKey, merkleTree)

const counterAddress = deriveAddress(Buffer.from('counter'), publicKey)
//const createAccountTx = createCompressedAccount(
// publicKey,
// bn(1_000),
// undefined,
// counterAddress
//)
const proofWithContext = await rpc.getValidityProofAndRpcContext()
const treeAccounts = defaultTestStateTreeAccounts()

const inputs: Buffer[] = []
const proof = proofWithContext.value.compressedProof

//treeAccounts.merkleTree
//treeAccounts.nullifierQueue
// TODO: Create compressed counteraccoun?

//const packed = packCompressedAccounts(
// [treeAccounts.merkleTree, treeAccounts.nullifierQueue],
// [],
// []
//)
// TODO: Add hashes and new addresses
const proofWithContext = await rpc.getValidityProofAndRpcContext()

// TODO: Create counter account
const inputs: Buffer[] = []
const proof = proofWithContext.value.compressedProof

// TODO: Use LUT to get indices?
const merkleContext = {
merkleTreePubkeyIndex: 0, // TODO: Merkle tree pubkey index
nullifierQueuePubkeyIndex: 0, // TODO: Nullifier queue pubkey index
merkleTreePubkeyIndex: 0,
nullifierQueuePubkeyIndex: 0,
leafIndex: 0,
queueIndex: null,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/buttons/create-mint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const CreateMintButton: FC = () => {
const rpc = createRpc()
const { mint, transactionSignature } = await createMint(
rpc,
wallet,
wallet as unknown as Signer,
wallet.publicKey,
9
)
Expand Down

0 comments on commit 0ad268a

Please sign in to comment.