Skip to content

Commit

Permalink
ft: allow state overrides as method
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul0tripathi committed Jun 18, 2024
1 parent a59e611 commit 2d7de23
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions services/smelter_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"

"github.com/ethereum/go-ethereum/common"
"github.com/rahul0tripathi/smelter/entity"
)

type SmelterRpc struct {
Expand Down Expand Up @@ -48,3 +49,13 @@ func (s *SmelterRpc) GetState(ctx context.Context) (json.RawMessage, error) {

return v, nil
}

func (s *SmelterRpc) SetStateOverrides(ctx context.Context, overrides entity.StateOverrides) error {
execCtx, err := s.execStorage.GetOrCreate(ctx)
if err != nil {
return err
}

execCtx.Overrides = overrides
return nil
}

0 comments on commit 2d7de23

Please sign in to comment.