mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
update tests
This commit is contained in:
parent
3bcadb7db7
commit
d777eed431
1 changed files with 22 additions and 17 deletions
|
|
@ -684,6 +684,7 @@ type fullLogRLP struct {
|
||||||
Topics []common.Hash
|
Topics []common.Hash
|
||||||
Data []byte
|
Data []byte
|
||||||
BlockNumber uint64
|
BlockNumber uint64
|
||||||
|
BlockTimestamp uint64
|
||||||
TxHash common.Hash
|
TxHash common.Hash
|
||||||
TxIndex uint
|
TxIndex uint
|
||||||
BlockHash common.Hash
|
BlockHash common.Hash
|
||||||
|
|
@ -696,6 +697,7 @@ func newFullLogRLP(l *types.Log) *fullLogRLP {
|
||||||
Topics: l.Topics,
|
Topics: l.Topics,
|
||||||
Data: l.Data,
|
Data: l.Data,
|
||||||
BlockNumber: l.BlockNumber,
|
BlockNumber: l.BlockNumber,
|
||||||
|
BlockTimestamp: l.BlockTimestamp,
|
||||||
TxHash: l.TxHash,
|
TxHash: l.TxHash,
|
||||||
TxIndex: l.TxIndex,
|
TxIndex: l.TxIndex,
|
||||||
BlockHash: l.BlockHash,
|
BlockHash: l.BlockHash,
|
||||||
|
|
@ -834,7 +836,7 @@ func TestDeriveLogFields(t *testing.T) {
|
||||||
// Derive log metadata fields
|
// Derive log metadata fields
|
||||||
number := big.NewInt(1)
|
number := big.NewInt(1)
|
||||||
hash := common.BytesToHash([]byte{0x03, 0x14})
|
hash := common.BytesToHash([]byte{0x03, 0x14})
|
||||||
types.Receipts(receipts).DeriveFields(params.TestChainConfig, hash, number.Uint64(), 0, big.NewInt(0), big.NewInt(0), txs)
|
types.Receipts(receipts).DeriveFields(params.TestChainConfig, hash, number.Uint64(), 12, big.NewInt(0), big.NewInt(0), txs)
|
||||||
|
|
||||||
// Iterate over all the computed fields and check that they're correct
|
// Iterate over all the computed fields and check that they're correct
|
||||||
logIndex := uint(0)
|
logIndex := uint(0)
|
||||||
|
|
@ -846,6 +848,9 @@ func TestDeriveLogFields(t *testing.T) {
|
||||||
if receipts[i].Logs[j].BlockHash != hash {
|
if receipts[i].Logs[j].BlockHash != hash {
|
||||||
t.Errorf("receipts[%d].Logs[%d].BlockHash = %s, want %s", i, j, receipts[i].Logs[j].BlockHash.String(), hash.String())
|
t.Errorf("receipts[%d].Logs[%d].BlockHash = %s, want %s", i, j, receipts[i].Logs[j].BlockHash.String(), hash.String())
|
||||||
}
|
}
|
||||||
|
if receipts[i].Logs[j].BlockTimestamp != 12 {
|
||||||
|
t.Errorf("receipts[%d].Logs[%d].BlockTimestamp = %d, want %d", i, j, receipts[i].Logs[j].BlockTimestamp, 12)
|
||||||
|
}
|
||||||
if receipts[i].Logs[j].TxHash != txs[i].Hash() {
|
if receipts[i].Logs[j].TxHash != txs[i].Hash() {
|
||||||
t.Errorf("receipts[%d].Logs[%d].TxHash = %s, want %s", i, j, receipts[i].Logs[j].TxHash.String(), txs[i].Hash().String())
|
t.Errorf("receipts[%d].Logs[%d].TxHash = %s, want %s", i, j, receipts[i].Logs[j].TxHash.String(), txs[i].Hash().String())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue