mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 06:53:46 +00:00
fix: skip epoch test in 32 bit environment
in 32 environment, ssz.HashTreeRoot() is different with the hash in 64 bit environment. so in 32 environment, some test will be skipped.
This commit is contained in:
parent
ee44050195
commit
2652c33d2d
6 changed files with 28 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/portalnetwork/utils"
|
"github.com/ethereum/go-ethereum/portalnetwork/utils"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
|
|
@ -24,8 +25,8 @@ var (
|
||||||
ErrPreMergeHeaderMustWithProof = errors.New("pre merge header must has accumulator proof")
|
ErrPreMergeHeaderMustWithProof = errors.New("pre merge header must has accumulator proof")
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed assets/merge_macc.bin
|
//go:embed assets/merge_macc.txt
|
||||||
var masterAccumulatorBytes []byte
|
var masterAccumulatorHex string
|
||||||
|
|
||||||
var zeroRecordBytes = make([]byte, 64)
|
var zeroRecordBytes = make([]byte, 64)
|
||||||
|
|
||||||
|
|
@ -240,6 +241,10 @@ func NewMasterAccumulator() (MasterAccumulator, error) {
|
||||||
var masterAcc = MasterAccumulator{
|
var masterAcc = MasterAccumulator{
|
||||||
HistoricalEpochs: make([][]byte, 0),
|
HistoricalEpochs: make([][]byte, 0),
|
||||||
}
|
}
|
||||||
err := masterAcc.UnmarshalSSZ(masterAccumulatorBytes)
|
masterAccumulatorBytes, err := hexutil.Decode(masterAccumulatorHex)
|
||||||
|
if err != nil {
|
||||||
|
return masterAcc, err
|
||||||
|
}
|
||||||
|
err = masterAcc.UnmarshalSSZ(masterAccumulatorBytes)
|
||||||
return masterAcc, err
|
return masterAcc, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
1
portalnetwork/history/assets/merge_macc.txt
Normal file
1
portalnetwork/history/assets/merge_macc.txt
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
portalnetwork/history/testdata/epoch.txt
vendored
Normal file
1
portalnetwork/history/testdata/epoch.txt
vendored
Normal file
File diff suppressed because one or more lines are too long
1
portalnetwork/history/testdata/shanghaibody.txt
vendored
Normal file
1
portalnetwork/history/testdata/shanghaibody.txt
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue