File tree Expand file tree Collapse file tree 4 files changed +7
-1
lines changed
validator_worker/src/core Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,7 @@ mod test {
547
547
. expect ( "failed to create id" ) ,
548
548
url : "http://localhost:8005" . to_string ( ) ,
549
549
fee : 100 . into ( ) ,
550
+ fee_addr : None ,
550
551
} ;
551
552
552
553
let follower_validator_desc = ValidatorDesc {
@@ -555,6 +556,7 @@ mod test {
555
556
. expect ( "failed to create id" ) ,
556
557
url : "http://localhost:8006" . to_string ( ) ,
557
558
fee : 100 . into ( ) ,
559
+ fee_addr : None ,
558
560
} ;
559
561
560
562
let mut valid_channel = Channel {
Original file line number Diff line number Diff line change @@ -45,12 +45,14 @@ lazy_static! {
45
45
id: ValidatorId :: try_from( "ce07CbB7e054514D590a0262C93070D838bFBA2e" ) . expect( "Failed to parse DUMMY_VALIDATOR_LEADER id " ) ,
46
46
url: "http://localhost:8005" . to_string( ) ,
47
47
fee: 100 . into( ) ,
48
+ fee_addr: None ,
48
49
} ;
49
50
50
51
pub static ref DUMMY_VALIDATOR_FOLLOWER : ValidatorDesc = ValidatorDesc {
51
52
id: ValidatorId :: try_from( "c91763d7f14ac5c5ddfbcd012e0d2a61ab9bded3" ) . expect( "Failed to parse DUMMY_VALIDATOR_FOLLOWER id " ) ,
52
53
url: "http://localhost:8006" . to_string( ) ,
53
54
fee: 100 . into( ) ,
55
+ fee_addr: None ,
54
56
} ;
55
57
56
58
pub static ref DUMMY_CHANNEL : Channel = {
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ impl fmt::Display for ValidatorId {
87
87
#[ serde( rename_all = "camelCase" ) ]
88
88
pub struct ValidatorDesc {
89
89
pub id : ValidatorId ,
90
+ pub fee_addr : Option < ValidatorId > ,
90
91
pub url : String ,
91
92
pub fee : BigNum ,
92
93
}
Original file line number Diff line number Diff line change @@ -76,8 +76,9 @@ fn distribute_fee<'a>(
76
76
} ;
77
77
78
78
if fee_rounded > 0 . into ( ) {
79
+ let addr = validator. fee_addr . as_ref ( ) . unwrap_or ( & validator. id ) ;
79
80
let entry = balances
80
- . entry ( validator . id . to_string ( ) )
81
+ . entry ( addr . to_string ( ) )
81
82
. or_insert_with ( || 0 . into ( ) ) ;
82
83
83
84
* entry += & fee_rounded;
You can’t perform that action at this time.
0 commit comments