@@ -169,7 +169,6 @@ func TestGetEpochNumbersBetween(t *testing.T) {
169169 assert .EqualError (t , err , "illegal begin block number" )
170170}
171171func TestGetBlockByEpochNumber (t * testing.T ) {
172- //todo
173172 blockchain , _ , currentBlock , signer , signFn := PrepareXDCTestBlockChainWithPenaltyForV2Engine (t , 1802 , params .TestXDPoSMockChainConfig )
174173
175174 blockCoinBase := "0x111000000000000000000000000000000123"
@@ -201,27 +200,31 @@ func TestGetBlockByEpochNumber(t *testing.T) {
201200 assert .Nil (t , err )
202201
203202 info , err := engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (0 )
204- assert .NotNil (t , err )
205- assert .Nil (t , info )
203+ assert .Equal (t , info . EpochConsensusVersion , "v1" )
204+ assert .Nil (t , err )
206205
207206 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (1 )
208- assert .Equal (t , info .EpochRound , types .Round (1 ))
207+ assert .Equal (t , * info .EpochRound , types .Round (1 ))
208+ assert .Equal (t , info .EpochConsensusVersion , "v2" )
209209 assert .Nil (t , err )
210210
211211 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (2 )
212- assert .Equal (t , info .EpochRound , types .Round (900 ))
212+ assert .Equal (t , * info .EpochRound , types .Round (900 ))
213+ assert .Equal (t , info .EpochConsensusVersion , "v2" )
213214 assert .Nil (t , err )
214215
215216 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (3 )
216- assert .Equal (t , info .EpochRound , types .Round (largeRound ))
217+ assert .Equal (t , * info .EpochRound , types .Round (largeRound ))
218+ assert .Equal (t , info .EpochConsensusVersion , "v2" )
217219 assert .Nil (t , err )
218220
219221 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (4 )
220222 assert .NotNil (t , err )
221223 assert .Nil (t , info )
222224
223225 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (5 )
224- assert .Equal (t , info .EpochRound , types .Round (largeRound2 ))
226+ assert .Equal (t , * info .EpochRound , types .Round (largeRound2 ))
227+ assert .Equal (t , info .EpochConsensusVersion , "v2" )
225228 assert .Nil (t , err )
226229
227230 info , err = engine .APIs (blockchain )[0 ].Service .(* XDPoS.API ).GetBlockInfoByEpochNum (6 )
0 commit comments