@@ -79,8 +79,6 @@ impl<'a> AddNodeResult<'a> {
7979pub struct NodeAddedToChain < ' a > {
8080 /// The ID assigned to this node.
8181 pub id : NodeId ,
82- /// The old label of the chain.
83- pub old_chain_label : Box < str > ,
8482 /// The new label of the chain.
8583 pub new_chain_label : & ' a str ,
8684 /// The node that was added.
@@ -97,8 +95,6 @@ pub struct RemovedNode {
9795 pub chain_node_count : usize ,
9896 /// Has the chain label been updated?
9997 pub has_chain_label_changed : bool ,
100- /// The old label of the chain.
101- pub old_chain_label : Box < str > ,
10298 /// Genesis hash of the chain to be updated.
10399 pub chain_genesis_hash : BlockHash ,
104100 /// The new label of the chain.
@@ -164,7 +160,6 @@ impl State {
164160 ) ;
165161
166162 let node = Node :: new ( node_details) ;
167- let old_chain_label = chain. label ( ) . into ( ) ;
168163
169164 match chain. add_node ( node) {
170165 chain:: AddNodeResult :: Overquota => AddNodeResult :: ChainOverQuota ,
@@ -174,7 +169,6 @@ impl State {
174169 AddNodeResult :: NodeAddedToChain ( NodeAddedToChain {
175170 id : NodeId ( chain_id, id) ,
176171 node : chain. get_node ( id) . expect ( "node added above" ) ,
177- old_chain_label,
178172 new_chain_label : chain. label ( ) ,
179173 chain_node_count : chain. node_count ( ) ,
180174 has_chain_label_changed : chain_renamed,
@@ -186,7 +180,6 @@ impl State {
186180 /// Remove a node
187181 pub fn remove_node ( & mut self , NodeId ( chain_id, chain_node_id) : NodeId ) -> Option < RemovedNode > {
188182 let chain = self . chains . get_mut ( chain_id) ?;
189- let old_chain_label = chain. label ( ) . into ( ) ;
190183
191184 // Actually remove the node
192185 let remove_result = chain. remove_node ( chain_node_id) ;
@@ -204,7 +197,6 @@ impl State {
204197 }
205198
206199 Some ( RemovedNode {
207- old_chain_label,
208200 new_chain_label,
209201 chain_node_count,
210202 chain_genesis_hash,
@@ -320,12 +312,11 @@ mod test {
320312 } ;
321313
322314 assert_eq ! ( add_node_result. id, NodeId ( 0 . into( ) , 0 . into( ) ) ) ;
323- assert_eq ! ( & * add_node_result. old_chain_label, "" ) ;
324315 assert_eq ! ( & * add_node_result. new_chain_label, "Chain One" ) ;
325316 assert_eq ! ( add_node_result. chain_node_count, 1 ) ;
326317 assert_eq ! ( add_node_result. has_chain_label_changed, true ) ;
327318
328- let add_result = state. add_node ( chain1_genesis, node ( "A" , "Chain One " ) ) ;
319+ let add_result = state. add_node ( chain1_genesis, node ( "A" , "Chain Two " ) ) ;
329320
330321 let add_node_result = match add_result {
331322 AddNodeResult :: ChainOnDenyList => panic ! ( "Chain not on deny list" ) ,
@@ -334,7 +325,7 @@ mod test {
334325 } ;
335326
336327 assert_eq ! ( add_node_result. id, NodeId ( 0 . into( ) , 1 . into( ) ) ) ;
337- assert_eq ! ( & * add_node_result . old_chain_label , " Chain One" ) ;
328+ // Chain One and Chain Two as common, so Chain One is kept.
338329 assert_eq ! ( & * add_node_result. new_chain_label, "Chain One" ) ;
339330 assert_eq ! ( add_node_result. chain_node_count, 2 ) ;
340331 assert_eq ! ( add_node_result. has_chain_label_changed, false ) ;
0 commit comments