diff --git a/state-chain/custom-rpc/src/lib.rs b/state-chain/custom-rpc/src/lib.rs index f450af29e2..bb8ea67284 100644 --- a/state-chain/custom-rpc/src/lib.rs +++ b/state-chain/custom-rpc/src/lib.rs @@ -54,6 +54,7 @@ pub enum RpcAccountInfo { is_online: bool, is_bidding: bool, bound_redeem_address: Option, + restricted_balances: BTreeMap, }, } @@ -107,6 +108,11 @@ impl RpcAccountInfo { is_online: info.is_online, is_bidding: info.is_bidding, bound_redeem_address: info.bound_redeem_address, + restricted_balances: info + .restricted_balances + .into_iter() + .map(|(address, balance)| (address, balance.into())) + .collect(), } } } @@ -988,6 +994,7 @@ mod test { is_online: true, is_qualified: true, bound_redeem_address: Some(H160::from([1; 20])), + restricted_balances: BTreeMap::from_iter(vec![(H160::from([1; 20]), 10u128.pow(18))]), }); assert_eq!( serde_json::to_value(validator).unwrap(), @@ -1004,7 +1011,10 @@ mod test { "last_heartbeat": 0, "online_credits": 0, "reputation_points": 0, - "role": "validator" + "role": "validator", + "restricted_balances": { + "0x0101010101010101010101010101010101010101": "0xde0b6b3a7640000" + } }) ); } diff --git a/state-chain/runtime/src/lib.rs b/state-chain/runtime/src/lib.rs index c94a576edb..995f33d292 100644 --- a/state-chain/runtime/src/lib.rs +++ b/state-chain/runtime/src/lib.rs @@ -936,6 +936,7 @@ impl_runtime_apis! { is_online: Reputation::is_qualified(&account_id), is_bidding, bound_redeem_address, + restricted_balances, } }