mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
update test to use fixed address
This commit is contained in:
parent
9a963dc5d0
commit
7198fc1225
1 changed files with 20 additions and 11 deletions
|
|
@ -1056,6 +1056,7 @@ func TestSimulateV1(t *testing.T) {
|
||||||
// Initialize test accounts
|
// Initialize test accounts
|
||||||
var (
|
var (
|
||||||
accounts = newAccounts(3)
|
accounts = newAccounts(3)
|
||||||
|
fixedAccount = newTestAccount()
|
||||||
genBlocks = 10
|
genBlocks = 10
|
||||||
signer = types.HomesteadSigner{}
|
signer = types.HomesteadSigner{}
|
||||||
cac = common.HexToAddress("0x0000000000000000000000000000000000000cac")
|
cac = common.HexToAddress("0x0000000000000000000000000000000000000cac")
|
||||||
|
|
@ -1631,19 +1632,19 @@ func TestSimulateV1(t *testing.T) {
|
||||||
From: &accounts[0].addr,
|
From: &accounts[0].addr,
|
||||||
To: &randomAccounts[0].addr,
|
To: &randomAccounts[0].addr,
|
||||||
Value: (*hexutil.Big)(big.NewInt(50)),
|
Value: (*hexutil.Big)(big.NewInt(50)),
|
||||||
Input: hex2Bytes(strings.TrimPrefix(randomAccounts[1].addr.String(), "0x")),
|
Input: hex2Bytes(strings.TrimPrefix(fixedAccount.addr.String(), "0x")),
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
includeTransfers: &includeTransfers,
|
includeTransfers: &includeTransfers,
|
||||||
want: []blockRes{{
|
want: []blockRes{{
|
||||||
Number: "0xb",
|
Number: "0xb",
|
||||||
GasLimit: "0x47e7c4",
|
GasLimit: "0x47e7c4",
|
||||||
GasUsed: "0xd984",
|
GasUsed: "0x77dc",
|
||||||
Miner: coinbase,
|
Miner: coinbase,
|
||||||
BaseFeePerGas: "0x0",
|
BaseFeePerGas: "0x0",
|
||||||
Calls: []callRes{{
|
Calls: []callRes{{
|
||||||
ReturnValue: "0x",
|
ReturnValue: "0x",
|
||||||
GasUsed: "0xd984",
|
GasUsed: "0x77dc",
|
||||||
Logs: []log{{
|
Logs: []log{{
|
||||||
Address: transferAddress,
|
Address: transferAddress,
|
||||||
Topics: []common.Hash{
|
Topics: []common.Hash{
|
||||||
|
|
@ -1658,7 +1659,7 @@ func TestSimulateV1(t *testing.T) {
|
||||||
Topics: []common.Hash{
|
Topics: []common.Hash{
|
||||||
transferTopic,
|
transferTopic,
|
||||||
addressToHash(randomAccounts[0].addr),
|
addressToHash(randomAccounts[0].addr),
|
||||||
addressToHash(randomAccounts[1].addr),
|
addressToHash(fixedAccount.addr),
|
||||||
},
|
},
|
||||||
Data: hexutil.Bytes(common.BigToHash(big.NewInt(100)).Bytes()),
|
Data: hexutil.Bytes(common.BigToHash(big.NewInt(100)).Bytes()),
|
||||||
BlockNumber: hexutil.Uint64(11),
|
BlockNumber: hexutil.Uint64(11),
|
||||||
|
|
@ -2530,6 +2531,14 @@ func newAccounts(n int) (accounts []account) {
|
||||||
return accounts
|
return accounts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func newTestAccount() account {
|
||||||
|
// testKey is a private key to use for funding a tester account.
|
||||||
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
|
// testAddr is the Ethereum address of the tester account.
|
||||||
|
addr := crypto.PubkeyToAddress(key.PublicKey)
|
||||||
|
return account{key: key, addr: addr}
|
||||||
|
}
|
||||||
|
|
||||||
func newRPCBalance(balance *big.Int) *hexutil.Big {
|
func newRPCBalance(balance *big.Int) *hexutil.Big {
|
||||||
rpcBalance := (*hexutil.Big)(balance)
|
rpcBalance := (*hexutil.Big)(balance)
|
||||||
return rpcBalance
|
return rpcBalance
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue