aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-05-10 22:04:10 +0800
committerGitHub <noreply@github.com>2019-05-10 22:04:10 +0800
commit6ec6b290511a7433a36a40d1e8c2cca3d9613d6f (patch)
tree617c1877b16ed53e116ec4481c9bac3d7c100905 /core/chain_makers.go
parent494f5d448a1685d5de4cb1524b863cd1fc9a13b0 (diff)
downloadgo-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar.gz
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar.bz2
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar.lz
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar.xz
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.tar.zst
go-tangerine-6ec6b290511a7433a36a40d1e8c2cca3d9613d6f.zip
core: fix import errors on clique crashes + empty blocks (#19544)
* core: fix import errors on clique crashes + empty blocks * cosensus/clique, core: add test for the mirrored state issue * core: address todo question wrt log count * core: raise a louder warning for non-clique known blocks
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index 754b543c7..17f404211 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -71,6 +71,13 @@ func (b *BlockGen) SetNonce(nonce types.BlockNonce) {
b.header.Nonce = nonce
}
+// SetDifficulty sets the difficulty field of the generated block. This method is
+// useful for Clique tests where the difficulty does not depend on time. For the
+// ethash tests, please use OffsetTime, which implicitly recalculates the diff.
+func (b *BlockGen) SetDifficulty(diff *big.Int) {
+ b.header.Difficulty = diff
+}
+
// AddTx adds a transaction to the generated block. If no coinbase has
// been set, the block's coinbase is set to the zero address.
//