@@ -29,10 +29,9 @@ export class Header {
2929 const stateRoot = new H256 ( decodedmsg [ 2 ] . toString ( "hex" ) ) ;
3030 const transactionsRoot = new H256 ( decodedmsg [ 3 ] . toString ( "hex" ) ) ;
3131 const nextValidatorSetHash = new H256 ( decodedmsg [ 4 ] . toString ( "hex" ) ) ;
32- const score = decodedmsg [ 5 ] ;
33- const number = new U256 ( parseInt ( decodedmsg [ 6 ] . toString ( "hex" ) , 16 ) ) ;
34- const timestamp = new U256 ( parseInt ( decodedmsg [ 7 ] . toString ( "hex" ) , 16 ) ) ;
35- const extraData = decodedmsg [ 8 ] ;
32+ const number = new U256 ( parseInt ( decodedmsg [ 5 ] . toString ( "hex" ) , 16 ) ) ;
33+ const timestamp = new U256 ( parseInt ( decodedmsg [ 6 ] . toString ( "hex" ) , 16 ) ) ;
34+ const extraData = decodedmsg [ 7 ] ;
3635
3736 // Be careful of the order! Three roots have same types, so mistake on the order will not be catched by typechecker.
3837 const header = new Header (
@@ -44,11 +43,10 @@ export class Header {
4443 transactionsRoot ,
4544 stateRoot ,
4645 nextValidatorSetHash ,
47- score ,
4846 [ ]
4947 ) ;
5048
51- for ( let i = 9 ; i < decodedmsg . getLength ( ) ; i ++ ) {
49+ for ( let i = 8 ; i < decodedmsg . getLength ( ) ; i ++ ) {
5250 header . seal . push ( decodedmsg [ i ] ) ;
5351 }
5452
@@ -62,7 +60,6 @@ export class Header {
6260 private transactionsRoot : H256 ;
6361 private stateRoot : H256 ;
6462 private nextValidatorSetHash : H256 ;
65- private score : U256 ;
6663 private seal : number [ ] [ ] ;
6764 private hash : null | H256 ;
6865 private bareHash : null | H256 ;
@@ -76,7 +73,6 @@ export class Header {
7673 transactionsRoot : H256 ,
7774 stateRoot : H256 ,
7875 nextValidatorSetHash : H256 ,
79- score : U256 ,
8076 seal : number [ ] [ ] ,
8177 hash ?: H256 ,
8278 bareHash ?: H256
@@ -89,7 +85,6 @@ export class Header {
8985 this . transactionsRoot = transactionsRoot ;
9086 this . stateRoot = stateRoot ;
9187 this . nextValidatorSetHash = nextValidatorSetHash ;
92- this . score = score ;
9388 this . seal = seal ;
9489 this . hash = hash == null ? this . hashing ( ) : hash ;
9590 this . bareHash = bareHash == null ? null : bareHash ;
@@ -127,10 +122,6 @@ export class Header {
127122 this . nextValidatorSetHash = root ;
128123 }
129124
130- public setScore ( score : U256 ) {
131- this . score = score ;
132- }
133-
134125 public setSeal ( seal : number [ ] [ ] ) {
135126 this . seal = seal ;
136127 }
@@ -143,10 +134,6 @@ export class Header {
143134 return this . bareHash ;
144135 }
145136
146- public getScore ( ) : U256 {
147- return this . score ;
148- }
149-
150137 public default ( ) : Header {
151138 return new Header (
152139 new H256 (
@@ -159,9 +146,6 @@ export class Header {
159146 BLAKE_NULL_RLP ,
160147 BLAKE_NULL_RLP ,
161148 BLAKE_NULL_RLP ,
162- new U256 (
163- "0000000000000000000000000000000000000000000000000000000000000000"
164- ) ,
165149 [ ]
166150 ) ;
167151 }
@@ -173,7 +157,6 @@ export class Header {
173157 this . stateRoot . toEncodeObject ( ) ,
174158 this . transactionsRoot . toEncodeObject ( ) ,
175159 this . nextValidatorSetHash . toEncodeObject ( ) ,
176- this . score . toEncodeObject ( ) ,
177160 this . number . toEncodeObject ( ) ,
178161 this . timestamp . toEncodeObject ( ) ,
179162 this . extraData
0 commit comments