mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 02:10:46 +00:00
fix wrong storage in genesis due to rlp changed behavior (EIP-2718)
This commit is contained in:
parent
8e07f0678f
commit
069cd8ebce
1 changed files with 1 additions and 5 deletions
|
|
@ -41,7 +41,6 @@ import (
|
||||||
randomizeContract "github.com/XinFinOrg/XDPoSChain/contracts/randomize"
|
randomizeContract "github.com/XinFinOrg/XDPoSChain/contracts/randomize"
|
||||||
validatorContract "github.com/XinFinOrg/XDPoSChain/contracts/validator"
|
validatorContract "github.com/XinFinOrg/XDPoSChain/contracts/validator"
|
||||||
"github.com/XinFinOrg/XDPoSChain/crypto"
|
"github.com/XinFinOrg/XDPoSChain/crypto"
|
||||||
"github.com/XinFinOrg/XDPoSChain/rlp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GenesisInput struct {
|
type GenesisInput struct {
|
||||||
|
|
@ -350,10 +349,7 @@ func (w *wizard) makeGenesis() {
|
||||||
code, _ := contractBackend.CodeAt(ctx, validatorAddress, nil)
|
code, _ := contractBackend.CodeAt(ctx, validatorAddress, nil)
|
||||||
storage := make(map[common.Hash]common.Hash)
|
storage := make(map[common.Hash]common.Hash)
|
||||||
f := func(key, val common.Hash) bool {
|
f := func(key, val common.Hash) bool {
|
||||||
decode := []byte{}
|
storage[key] = common.BytesToHash(val.Bytes())
|
||||||
trim := bytes.TrimLeft(val.Bytes(), "\x00")
|
|
||||||
rlp.DecodeBytes(trim, &decode)
|
|
||||||
storage[key] = common.BytesToHash(decode)
|
|
||||||
log.Info("DecodeBytes", "value", val.String(), "decode", storage[key].String())
|
log.Info("DecodeBytes", "value", val.String(), "decode", storage[key].String())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue