forked from gmart7t2/ord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subsidy.rs
57 lines (52 loc) Β· 1.16 KB
/
subsidy.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use {super::*, ord::subcommand::subsidy::Output};
#[test]
fn genesis() {
assert_eq!(
CommandBuilder::new("subsidy 0").run_and_deserialize_output::<Output>(),
Output {
first: 0,
subsidy: 5000000000,
name: "nvtdijuwxlp".into(),
}
);
}
#[test]
fn second_block() {
assert_eq!(
CommandBuilder::new("subsidy 1").run_and_deserialize_output::<Output>(),
Output {
first: 5000000000,
subsidy: 5000000000,
name: "nvtcsezkbth".into(),
}
);
}
#[test]
fn second_to_last_block_with_subsidy() {
assert_eq!(
CommandBuilder::new("subsidy 6929998").run_and_deserialize_output::<Output>(),
Output {
first: 2099999997689998,
subsidy: 1,
name: "b".into(),
}
);
}
#[test]
fn last_block_with_subsidy() {
assert_eq!(
CommandBuilder::new("subsidy 6929999").run_and_deserialize_output::<Output>(),
Output {
first: 2099999997689999,
subsidy: 1,
name: "a".into(),
}
);
}
#[test]
fn first_block_without_subsidy() {
CommandBuilder::new("subsidy 6930000")
.expected_stderr("error: block 6930000 has no subsidy\n")
.expected_exit_code(1)
.run_and_extract_stdout();
}