Skip to content

Commit d8a1cd3

Browse files
committed
Test blockTimestamp
1 parent 189e24f commit d8a1cd3

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

internal/ethapi/api_test.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,10 +1327,11 @@ func TestSimulateV1(t *testing.T) {
13271327
validation = true
13281328
)
13291329
type log struct {
1330-
Address common.Address `json:"address"`
1331-
Topics []common.Hash `json:"topics"`
1332-
Data hexutil.Bytes `json:"data"`
1333-
BlockNumber hexutil.Uint64 `json:"blockNumber"`
1330+
Address common.Address `json:"address"`
1331+
Topics []common.Hash `json:"topics"`
1332+
Data hexutil.Bytes `json:"data"`
1333+
BlockNumber hexutil.Uint64 `json:"blockNumber"`
1334+
BlockTimestamp hexutil.Uint64 `json:"blockTimestamp"`
13341335
// Skip txHash
13351336
//TxHash common.Hash `json:"transactionHash" gencodec:"required"`
13361337
TxIndex hexutil.Uint `json:"transactionIndex"`
@@ -1677,10 +1678,11 @@ func TestSimulateV1(t *testing.T) {
16771678
Calls: []callRes{{
16781679
ReturnValue: "0x",
16791680
Logs: []log{{
1680-
Address: randomAccounts[2].addr,
1681-
Topics: []common.Hash{common.HexToHash("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},
1682-
BlockNumber: hexutil.Uint64(11),
1683-
Data: hexutil.Bytes{},
1681+
Address: randomAccounts[2].addr,
1682+
Topics: []common.Hash{common.HexToHash("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},
1683+
BlockNumber: hexutil.Uint64(11),
1684+
BlockTimestamp: hexutil.Uint64(0x70),
1685+
Data: hexutil.Bytes{},
16841686
}},
16851687
GasUsed: "0x5508",
16861688
Status: "0x1",
@@ -1853,18 +1855,20 @@ func TestSimulateV1(t *testing.T) {
18531855
addressToHash(accounts[0].addr),
18541856
addressToHash(randomAccounts[0].addr),
18551857
},
1856-
Data: hexutil.Bytes(common.BigToHash(big.NewInt(50)).Bytes()),
1857-
BlockNumber: hexutil.Uint64(11),
1858+
Data: hexutil.Bytes(common.BigToHash(big.NewInt(50)).Bytes()),
1859+
BlockNumber: hexutil.Uint64(11),
1860+
BlockTimestamp: hexutil.Uint64(0x70),
18581861
}, {
18591862
Address: transferAddress,
18601863
Topics: []common.Hash{
18611864
transferTopic,
18621865
addressToHash(randomAccounts[0].addr),
18631866
addressToHash(fixedAccount.addr),
18641867
},
1865-
Data: hexutil.Bytes(common.BigToHash(big.NewInt(100)).Bytes()),
1866-
BlockNumber: hexutil.Uint64(11),
1867-
Index: hexutil.Uint(1),
1868+
Data: hexutil.Bytes(common.BigToHash(big.NewInt(100)).Bytes()),
1869+
BlockNumber: hexutil.Uint64(11),
1870+
BlockTimestamp: hexutil.Uint64(0x70),
1871+
Index: hexutil.Uint(1),
18681872
}},
18691873
Status: "0x1",
18701874
}},

0 commit comments

Comments
 (0)