mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +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"
|
||||
validatorContract "github.com/XinFinOrg/XDPoSChain/contracts/validator"
|
||||
"github.com/XinFinOrg/XDPoSChain/crypto"
|
||||
"github.com/XinFinOrg/XDPoSChain/rlp"
|
||||
)
|
||||
|
||||
type GenesisInput struct {
|
||||
|
|
@ -350,10 +349,7 @@ func (w *wizard) makeGenesis() {
|
|||
code, _ := contractBackend.CodeAt(ctx, validatorAddress, nil)
|
||||
storage := make(map[common.Hash]common.Hash)
|
||||
f := func(key, val common.Hash) bool {
|
||||
decode := []byte{}
|
||||
trim := bytes.TrimLeft(val.Bytes(), "\x00")
|
||||
rlp.DecodeBytes(trim, &decode)
|
||||
storage[key] = common.BytesToHash(decode)
|
||||
storage[key] = common.BytesToHash(val.Bytes())
|
||||
log.Info("DecodeBytes", "value", val.String(), "decode", storage[key].String())
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue