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

Akayi/bugfix #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions host/src/jubjub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ pub fn test_bit(b: &[u8], i: usize) -> bool {
#[cfg(test)]
mod tests {
use super::Point;
use crate::utils::bn_to_field;
use crate::utils::field_to_bn;
use halo2_proofs::pairing::bn256::Fr;
use crate::jubjub::bn_to_field;
use bytes_helper::field_to_bn;
use num_bigint::BigUint;
use std::str::FromStr;
#[test]
Expand Down Expand Up @@ -276,7 +275,7 @@ mod tests {
println!(
"base x is: {:?} {:?}",
BigUint::to_u64_digits(&base_x),
BigUint::to_u64_digits(&field_to_bn(&-bn_to_field::<Fr>(&base_x)))
BigUint::to_u64_digits(&field_to_bn(&bn_to_field(&base_x)))
);
println!(
"base y is: {:?} {:?}",
Expand Down
6 changes: 6 additions & 0 deletions ts/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const sigx = new LeHexBN("0x8a4414099b0a433851f7fb34e43febb1298193da413a35bb6951
const sigy = new LeHexBN("0x7e243e753a4b0a792c02c9d550c5569fe5b46a9f710d9d123cd2865e0184fb12");
const sigr = new LeHexBN("0x1e900bb388808fe40f0a11a149a322f576448d497040d72c7b3ebc832d02e701");

const CMD_INSTALL_PLAYER = 1n;
const CMD_WITHDRAW= 4n;

export function createCommand(command: bigint, objindex: bigint) {
Expand All @@ -22,6 +23,11 @@ async function main() {
//const rpc = new ZKWasmAppRpc("http://101.36.120.170:20157");
const rpc = new ZKWasmAppRpc("http://localhost:3000");
rpc.query_config();

// install player
const insPlayerCmd = createCommand(CMD_INSTALL_PLAYER, 0n);
rpc.send_transaction([insPlayerCmd, 0n, 0n, 0n], "1234");

rpc.query_state([1n], "1234");
rpc.query_state([1n], "1234");
rpc.query_state([1n], "1234");
Expand Down
2 changes: 0 additions & 2 deletions ts/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ async function main() {
//console.log(application);
await (initApplication as any)(bootstrap);

console.log("check merkel database connection ...");
test_merkle_db_service();
//initialize merkle_root based on the latest task
/*
if (deploymode) {
Expand Down