Skip to content

Commit

Permalink
Expose state trie to plugins
Browse files Browse the repository at this point in the history
Also merged changes in support geth v1.11.6. Updated to plugeth-utils v1.1.0.
  • Loading branch information
philip-morlier committed May 5, 2023
1 parent bdda4b3 commit 829b8c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/mattn/go-isatty v0.0.16
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
github.com/olekukonko/tablewriter v0.0.5
github.com/openrelayxyz/plugeth-utils v0.0.25
github.com/openrelayxyz/plugeth-utils v1.1.0
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7
github.com/rs/cors v1.7.0
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8=
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
Expand Down Expand Up @@ -351,10 +349,8 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/openrelayxyz/plugeth-utils v0.0.24 h1:Q2BR3SlwHovNFLbEtGrFFqgOCnL+ONyrwTC9wKKAej4=
github.com/openrelayxyz/plugeth-utils v0.0.24/go.mod h1:W1Hwwhv04MCuNCcI6a62/kL6eWbH7OO+KvpBEyQTgIs=
github.com/openrelayxyz/plugeth-utils v0.0.25 h1:UG9XNBA+V3ZVSXRpBIBXpa7fQIPd5MczrnBQTMpK1GY=
github.com/openrelayxyz/plugeth-utils v0.0.25/go.mod h1:W1Hwwhv04MCuNCcI6a62/kL6eWbH7OO+KvpBEyQTgIs=
github.com/openrelayxyz/plugeth-utils v1.1.0 h1:pK02TCFT32G/o/GNgAF+i3CihWfa/G71i0/vB9PHG3k=
github.com/openrelayxyz/plugeth-utils v1.1.0/go.mod h1:W1Hwwhv04MCuNCcI6a62/kL6eWbH7OO+KvpBEyQTgIs=
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down
2 changes: 1 addition & 1 deletion plugins/wrappers/backendwrapper/backendwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func (b *Backend) GetAccountTrie(stateRoot core.Hash, account core.Address) (cor
if err != nil {
return nil, err
}
act, err := tr.TryGetAccount(account)
act, err := tr.GetAccount(account)
if err != nil {
return nil, err
}
Expand Down
7 changes: 2 additions & 5 deletions plugins/wrappers/backendwrapper/triewrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ func NewWrappedTrie(t state.Trie) core.Trie {
func (t *WrappedTrie) GetKey(b []byte) []byte {
return t.t.GetKey(b)
}
func (t *WrappedTrie) TryGet(key []byte) ([]byte, error) {
return t.t.TryGet(key)
}

func (t *WrappedTrie) TryGetAccount(address core.Address) (*core.StateAccount, error) {
act, err := t.t.TryGetAccount(common.Address(address))
func (t *WrappedTrie) GetAccount(address core.Address) (*core.StateAccount, error) {
act, err := t.t.GetAccount(common.Address(address))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 829b8c4

Please sign in to comment.