File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -828,11 +828,19 @@ impl TermInfo for Client {
828828 }
829829
830830 fn term_common_params ( & self , id : BlockId ) -> Option < CommonParams > {
831- let block_number = self . last_term_finished_block_num ( id) . expect ( "The block of the parent hash should exist" ) ;
832- if block_number == 0 {
833- None
831+ let state = self . state_at ( id) ?;
832+ let metadata = state. metadata ( ) . unwrap ( ) . expect ( "Metadata always exist" ) ;
833+
834+ if let Some ( term_params) = metadata. term_params ( ) {
835+ Some ( term_params. clone ( ) )
834836 } else {
835- Some ( self . common_params ( ( block_number) . into ( ) ) . expect ( "Common params should exist" ) )
837+ let block_number =
838+ self . last_term_finished_block_num ( id) . expect ( "The block of the parent hash should exist" ) ;
839+ if block_number == 0 {
840+ None
841+ } else {
842+ Some ( self . common_params ( ( block_number) . into ( ) ) . expect ( "Common params should exist" ) )
843+ }
836844 }
837845 }
838846}
You can’t perform that action at this time.
0 commit comments