Skip to content

Commit

Permalink
docs: upgrade node #8
Browse files Browse the repository at this point in the history
  • Loading branch information
eigmax committed Aug 19, 2022
1 parent 01b484f commit cb0ef65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -19,7 +19,7 @@ yarn test

```
@ieigen/tss-wasm: 0.0.4
@ieigen/tss-wasm-node: 0.0.1
@ieigen/tss-wasm-node: 0.0.1, node 18.0+ is required
```

# SM Server
Expand Down
32 changes: 3 additions & 29 deletions src/api.rs
Expand Up @@ -70,7 +70,6 @@ fn new_client_with_headers() -> Client {
#[wasm_bindgen]
pub async fn gg18_keygen_client_new_context(addr: String, t: usize, n: usize) -> String {
let client = new_client_with_headers();
//let delay = time::Duration::from_millis(25);
let params = Parameters {
threshold: t,
share_count: n,
Expand Down Expand Up @@ -124,7 +123,6 @@ pub async fn gg18_keygen_client_round1(context: String) -> String {
&context.addr,
context.party_num_int,
context.params.share_count as u16,
//delay,
"round1",
context.uuid.clone(),
)
Expand Down Expand Up @@ -407,7 +405,6 @@ pub async fn signup(client: &Client, addr: &str) -> Result<PartySignup, ()> {
pub async fn gg18_keygen(t: usize, n: usize) -> String {
let client = new_client_with_headers();
let addr = "http://127.0.0.1:8000";
//let delay = time::Duration::from_millis(25);
let params = Parameters {
threshold: t,
share_count: n.clone(),
Expand Down Expand Up @@ -438,7 +435,6 @@ pub async fn gg18_keygen(t: usize, n: usize) -> String {
addr,
party_num_int,
PARTIES,
//delay,
"round1",
uuid.clone(),
)
Expand Down Expand Up @@ -468,7 +464,6 @@ pub async fn gg18_keygen(t: usize, n: usize) -> String {
addr,
party_num_int,
PARTIES,
//delay,
"round2",
uuid.clone(),
)
Expand Down Expand Up @@ -535,7 +530,6 @@ pub async fn gg18_keygen(t: usize, n: usize) -> String {
addr,
party_num_int,
PARTIES,
//delay,
"round3",
uuid.clone(),
)
Expand Down Expand Up @@ -574,7 +568,6 @@ pub async fn gg18_keygen(t: usize, n: usize) -> String {
addr,
party_num_int,
PARTIES,
//delay,
"round4",
uuid.clone(),
)
Expand Down Expand Up @@ -618,7 +611,7 @@ pub async fn gg18_keygen(t: usize, n: usize) -> String {
addr,
party_num_int,
PARTIES,
/*delay,*/ "round5",
"round5",
uuid,
)
.await;
Expand Down Expand Up @@ -1033,7 +1026,6 @@ pub async fn gg18_sign_client_round3(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
//delay,
"round3",
context.uuid.clone(),
)
Expand Down Expand Up @@ -1074,7 +1066,6 @@ pub async fn gg18_sign_client_round4(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
//delay,
"round4",
context.uuid.clone(),
)
Expand Down Expand Up @@ -1153,7 +1144,6 @@ pub async fn gg18_sign_client_round5(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
//delay,
"round5",
context.uuid.clone(),
)
Expand Down Expand Up @@ -1197,7 +1187,6 @@ pub async fn gg18_sign_client_round6(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
//delay,
"round6",
context.uuid.clone(),
)
Expand Down Expand Up @@ -1274,7 +1263,6 @@ pub async fn gg18_sign_client_round7(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
//delay,
"round7",
context.uuid.clone(),
)
Expand Down Expand Up @@ -1372,7 +1360,7 @@ pub async fn gg18_sign_client_round9(context: String) -> String {
&context.addr,
context.party_num_int,
context.threshould + 1,
/*delay,*/ "round9",
"round9",
context.uuid.clone(),
)
.await;
Expand Down Expand Up @@ -1412,11 +1400,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
let message = &message[..];
let client = new_client_with_headers();
let addr = "http://127.0.0.1:8000";
// delay:
//let delay = time::Duration::from_millis(25);
// read key file
//let data = fs::read_to_string(env::args().nth(2).unwrap())
// .expect("Unable to load keys, did you run keygen first? ");
let (party_keys, shared_keys, party_id, vss_scheme_vec, paillier_key_vector, y_sum): (
Keys,
SharedKeys,
Expand Down Expand Up @@ -1449,7 +1432,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round0",
uuid.clone(),
)
Expand Down Expand Up @@ -1495,7 +1477,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round1",
uuid.clone(),
)
Expand Down Expand Up @@ -1576,7 +1557,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round2",
uuid.clone(),
)
Expand Down Expand Up @@ -1640,7 +1620,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round3",
uuid.clone(),
)
Expand Down Expand Up @@ -1671,7 +1650,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round4",
uuid.clone(),
)
Expand Down Expand Up @@ -1721,7 +1699,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round5",
uuid.clone(),
)
Expand Down Expand Up @@ -1756,7 +1733,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round6",
uuid.clone(),
)
Expand Down Expand Up @@ -1810,7 +1786,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round7",
uuid.clone(),
)
Expand Down Expand Up @@ -1840,7 +1815,6 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
//delay,
"round8",
uuid.clone(),
)
Expand Down Expand Up @@ -1885,7 +1859,7 @@ pub async fn gg18_sign(t: usize, n: usize, key_store: String, message_str: Strin
addr,
party_num_int,
THRESHOLD + 1,
/*delay,*/ "round9",
"round9",
uuid,
)
.await;
Expand Down
11 changes: 0 additions & 11 deletions src/common.rs
Expand Up @@ -10,8 +10,6 @@ use wasm_bindgen::JsCast;
use wasm_bindgen::JsValue;
use wasm_bindgen_futures::JsFuture;

use crate::log;

use crate::curv::{
arithmetic::num_bigint::BigInt,
arithmetic::traits::Converter,
Expand Down Expand Up @@ -91,18 +89,9 @@ pub async fn postb<T>(client: &Client, addr: &str, path: &str, body: T) -> Optio
where
T: serde::ser::Serialize,
{
// let addr = "http://127.0.0.1:8000".to_string();
// let retries = 3;
let url = format!("{}/{}", addr, path);

// let mut headers = HeaderMap::new();
// headers.insert("Content-Type", HeaderValue::from_static("Content-Type:application/json; charset=utf-8"));
// headers.insert("Accept", HeaderValue::from_static("application/json; charset=utf-8"));

// let client = reqwest::Client::builder()
// .default_headers(headers)
// .build().unwrap();

let res = client
.post(url)
.header("Content-Type", "application/json; charset=utf-8")
Expand Down

0 comments on commit cb0ef65

Please sign in to comment.