mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
state override no pointer
This commit is contained in:
parent
bbdbcd84ce
commit
baa9835ee8
2 changed files with 7 additions and 7 deletions
|
|
@ -830,17 +830,17 @@ type SimulateOptions struct {
|
||||||
|
|
||||||
// SimulateBlock represents a batch of calls to be simulated.
|
// SimulateBlock represents a batch of calls to be simulated.
|
||||||
type SimulateBlock struct {
|
type SimulateBlock struct {
|
||||||
BlockOverrides *ethereum.BlockOverrides `json:"blockOverrides,omitempty"`
|
BlockOverrides *ethereum.BlockOverrides `json:"blockOverrides,omitempty"`
|
||||||
StateOverrides *map[common.Address]ethereum.OverrideAccount `json:"stateOverrides,omitempty"`
|
StateOverrides map[common.Address]ethereum.OverrideAccount `json:"stateOverrides,omitempty"`
|
||||||
Calls []ethereum.CallMsg `json:"calls"`
|
Calls []ethereum.CallMsg `json:"calls"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON implements json.Marshaler for SimulateBlock.
|
// MarshalJSON implements json.Marshaler for SimulateBlock.
|
||||||
func (s SimulateBlock) MarshalJSON() ([]byte, error) {
|
func (s SimulateBlock) MarshalJSON() ([]byte, error) {
|
||||||
type Alias struct {
|
type Alias struct {
|
||||||
BlockOverrides *ethereum.BlockOverrides `json:"blockOverrides,omitempty"`
|
BlockOverrides *ethereum.BlockOverrides `json:"blockOverrides,omitempty"`
|
||||||
StateOverrides *map[common.Address]ethereum.OverrideAccount `json:"stateOverrides,omitempty"`
|
StateOverrides map[common.Address]ethereum.OverrideAccount `json:"stateOverrides,omitempty"`
|
||||||
Calls []interface{} `json:"calls"`
|
Calls []interface{} `json:"calls"`
|
||||||
}
|
}
|
||||||
calls := make([]interface{}, len(s.Calls))
|
calls := make([]interface{}, len(s.Calls))
|
||||||
for i, call := range s.Calls {
|
for i, call := range s.Calls {
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,7 @@ func TestSimulateV1WithStateOverrides(t *testing.T) {
|
||||||
opts := ethclient.SimulateOptions{
|
opts := ethclient.SimulateOptions{
|
||||||
BlockStateCalls: []ethclient.SimulateBlock{
|
BlockStateCalls: []ethclient.SimulateBlock{
|
||||||
{
|
{
|
||||||
StateOverrides: &stateOverrides,
|
StateOverrides: stateOverrides,
|
||||||
Calls: []ethereum.CallMsg{
|
Calls: []ethereum.CallMsg{
|
||||||
{
|
{
|
||||||
From: from,
|
From: from,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue