From f4a828f4dadbdef0dbf49a388fd910eb7b84c2a9 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 14 Oct 2024 23:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E7=82=B9=E5=88=AB=E7=9A=84test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miner/src/cacluate.rs | 2 +- miner/src/name.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/miner/src/cacluate.rs b/miner/src/cacluate.rs index 6065d0d..9f0a2cc 100644 --- a/miner/src/cacluate.rs +++ b/miner/src/cacluate.rs @@ -279,7 +279,7 @@ pub fn schdule_threads(cli_arg: Command, out_path: PathBuf) { /// 所有的状态输出都在子线程, 也就是这里 /// /// 1. 通过 `Receiver` 获取到主线程的数据 -/// +/// /// 获取到数据后, 开始计算 /// 计算完一个 batch 后, 输出一次状态 /// 这里的状态是在所有运算线程中共享的一个状态 diff --git a/miner/src/name.rs b/miner/src/name.rs index d6781bf..7b61410 100644 --- a/miner/src/name.rs +++ b/miner/src/name.rs @@ -707,6 +707,22 @@ mod test { #[test] fn val_test() { let team = TeamNamer::new_unchecked("x"); + + let team_val: Vec = vec![ + 0, 59, 5, 27, 36, 119, 125, 25, 127, 133, 143, 18, 88, 163, 214, 134, 72, 85, 55, 103, 58, 80, 12, 3, 197, 86, 112, + 227, 37, 180, 202, 184, 126, 15, 169, 96, 35, 149, 160, 90, 130, 10, 207, 254, 31, 253, 194, 150, 198, 111, 161, 87, + 128, 129, 24, 73, 238, 34, 245, 168, 52, 42, 232, 142, 152, 135, 201, 132, 200, 144, 203, 138, 154, 141, 109, 47, + 155, 93, 145, 82, 185, 113, 186, 69, 217, 166, 210, 92, 131, 183, 151, 171, 251, 40, 98, 195, 41, 7, 244, 30, 26, 65, + 179, 16, 100, 218, 211, 120, 45, 237, 182, 8, 137, 107, 67, 61, 176, 249, 190, 123, 122, 243, 70, 247, 174, 241, 209, + 148, 228, 50, 208, 14, 51, 146, 117, 68, 162, 234, 102, 104, 62, 11, 76, 84, 9, 139, 224, 235, 108, 44, 78, 222, 242, + 167, 89, 172, 114, 115, 221, 233, 140, 193, 255, 191, 4, 188, 66, 29, 6, 64, 204, 192, 178, 77, 216, 196, 57, 164, + 95, 75, 229, 212, 223, 215, 97, 136, 220, 38, 219, 94, 158, 252, 226, 21, 239, 157, 32, 39, 124, 46, 105, 175, 230, + 156, 248, 106, 116, 43, 101, 250, 231, 28, 147, 173, 177, 187, 20, 181, 205, 22, 91, 83, 225, 1, 81, 99, 199, 246, + 63, 48, 54, 13, 118, 79, 19, 170, 153, 165, 213, 110, 23, 121, 206, 159, 236, 2, 33, 71, 49, 56, 74, 60, 189, 53, + 240, 17, + ]; + assert_eq!(team.clone_vals().to_vec(), team_val); + let namer = Namer::new_from_team_namer_unchecked(&team, "x"); let val_vec: Vec = vec![