internal/ethapi: rm state override and set code in genesis for TestSimulateV1ChainLinkage

This commit is contained in:
lightclient 2025-02-18 14:39:10 -07:00
parent dcb4f05791
commit 746755e415
No known key found for this signature in database
GPG Key ID: 657913021EF45A6A
1 changed files with 11 additions and 18 deletions

View File

@ -2312,17 +2312,18 @@ func TestSimulateV1(t *testing.T) {
func TestSimulateV1ChainLinkage(t *testing.T) {
var (
acc = newTestAccount()
sender = acc.addr
gspec = &core.Genesis{
Config: params.MergedTestChainConfig,
Alloc: types.GenesisAlloc{
sender: {Balance: big.NewInt(params.Ether)},
},
}
signer = types.LatestSigner(params.MergedTestChainConfig)
acc = newTestAccount()
sender = acc.addr
contractAddr = common.Address{0xaa, 0xaa}
recipient = common.Address{0xbb, 0xbb}
gspec = &core.Genesis{
Config: params.MergedTestChainConfig,
Alloc: types.GenesisAlloc{
sender: {Balance: big.NewInt(params.Ether)},
contractAddr: {Code: common.Hex2Bytes("5f35405f8114600f575f5260205ff35b5f80fd")},
},
}
signer = types.LatestSigner(params.MergedTestChainConfig)
)
backend := newTestBackend(t, 1, gspec, beacon.New(ethash.NewFaker()), func(i int, b *core.BlockGen) {
tx := types.MustSignNewTx(acc.key, signer, &types.LegacyTx{
@ -2378,15 +2379,7 @@ func TestSimulateV1ChainLinkage(t *testing.T) {
blocks = []simBlock{
{Calls: []TransactionArgs{call1}},
{Calls: []TransactionArgs{call2}},
{
StateOverrides: &override.StateOverride{
contractAddr: override.OverrideAccount{
// Takes block number as input and returns the block hash.
Code: hex2Bytes("0x5f35405f8114600f575f5260205ff35b5f80fd"),
},
},
Calls: []TransactionArgs{call3a, call3b},
},
{Calls: []TransactionArgs{call3a, call3b}},
}
)