Skip to content

Commit

Permalink
enable v3
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Jun 6, 2024
1 parent 084a4bb commit 84d9abb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions action/protocol/staking/ethabi/stake_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
stakingComm "github.com/iotexproject/iotex-core/action/protocol/staking/ethabi/common"
v1 "github.com/iotexproject/iotex-core/action/protocol/staking/ethabi/v1"
v2 "github.com/iotexproject/iotex-core/action/protocol/staking/ethabi/v2"
v3 "github.com/iotexproject/iotex-core/action/protocol/staking/ethabi/v3"
)

// BuildReadStateRequest decode eth_call data to StateContext
Expand All @@ -21,5 +22,9 @@ func BuildReadStateRequest(data []byte) (protocol.StateContext, error) {
if err == nil {
return methodSig, nil
}
methodSig, err = v3.BuildReadStateRequest(data)
if err == nil {
return methodSig, nil
}
return nil, stakingComm.ErrInvalidCallSig
}
4 changes: 0 additions & 4 deletions action/protocol/staking/ethabi/v3/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import (
)

func BuildReadStateRequest(data []byte) (protocol.StateContext, error) {
if len(data) < 4 {
return nil, stakingComm.ErrInvalidCallData
}

switch methodSig := hex.EncodeToString(data[:4]); methodSig {
case hex.EncodeToString(_compositeBucketsMethod.ID):
return newCompositeBucketsStateContext(data[4:])
Expand Down

0 comments on commit 84d9abb

Please sign in to comment.