TestChainClientI is an interface for providing different chain consensus. Among clients, BlockHeader structure might be different, but it also might be helpful for testing cases to use the last header.
Another reason for getting the last header as an interface is to enable warping the TestChainClientI and intercept client methods. Currently, the implementers of TestChainClientI such as TestChainTendermint use direct casting to the type TestChainTendermint for getting the last header, making it an interface will make the casting redundant and allows the creation of a wrapper.
Change
Add GetLastHeader to TestChainClientI and don't use direct casting
Change2
Fix missing EndBlock()
Overview
In many places in the simulation, there is no call to EndBlock() after the Commit() process. It leads to misbehavior of the chain as EndBlock() is part of the block lifecycle
Change
Add EndBlock() when needed
Note
There are also many calls to BeginBlock() for the same block. It also needs to be watched.
Change1
Add
GetLastHeader()
to TestChainClientIOverview
TestChainClientI is an interface for providing different chain consensus. Among clients, BlockHeader structure might be different, but it also might be helpful for testing cases to use the last header. Another reason for getting the last header as an interface is to enable warping the TestChainClientI and intercept client methods. Currently, the implementers of TestChainClientI such as TestChainTendermint use direct casting to the type TestChainTendermint for getting the last header, making it an interface will make the casting redundant and allows the creation of a wrapper.
Change
Add GetLastHeader to TestChainClientI and don't use direct casting
Change2
Fix missing
EndBlock()
Overview
In many places in the simulation, there is no call to
EndBlock()
after theCommit()
process. It leads to misbehavior of the chain asEndBlock()
is part of the block lifecycleChange
Add
EndBlock()
when neededNote
There are also many calls to
BeginBlock()
for the same block. It also needs to be watched.