forked from cerc-io/laconicd-deprecated
grpc: add eth_call query command (#236)
* add eth_call query command Implement EthCall grpc query api Closes #229 add eth_call query command fix codec issue use query client use grpc status error and codes validate address length in grpc handler * Update x/evm/types/callargs.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
co-authored by
Federico Kunze Küllmer
parent
7951852bb0
commit
0020e4f2cd
@@ -2,6 +2,7 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -364,3 +365,34 @@ func (k Keeper) StaticCall(c context.Context, req *types.QueryStaticCallRequest)
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// EthCall implements eth_call rpc api.
|
||||
func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
k.WithContext(ctx)
|
||||
|
||||
var args types.CallArgs
|
||||
err := json.Unmarshal(req.Args, &args)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
|
||||
msg := args.ToMessage(uint64(ethermint.DefaultRPCGasLimit))
|
||||
|
||||
cfg, found := k.GetChainConfig(ctx)
|
||||
if !found {
|
||||
return nil, status.Error(codes.Internal, types.ErrChainConfigNotFound.Error())
|
||||
}
|
||||
ethCfg := cfg.EthereumConfig(k.eip155ChainID)
|
||||
evm := k.NewEVM(msg, ethCfg)
|
||||
res, err := k.ApplyMessage(evm, msg, ethCfg)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
// ApplyMessage don't handle gas refund, let's do it here
|
||||
refund := k.GasToRefund(res.GasUsed)
|
||||
res.GasUsed -= refund
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@@ -258,6 +258,17 @@ func (k *Keeper) GetEthIntrinsicGas(msg core.Message, cfg *params.ChainConfig, i
|
||||
return core.IntrinsicGas(msg.Data(), msg.AccessList(), isContractCreation, homestead, istanbul)
|
||||
}
|
||||
|
||||
// GasToRefund calculate the amount of gas should refund to sender
|
||||
func (k *Keeper) GasToRefund(gasConsumed uint64) uint64 {
|
||||
// Apply refund counter, capped to half of the used gas.
|
||||
refund := gasConsumed / 2
|
||||
availableRefund := k.GetRefund()
|
||||
if refund > availableRefund {
|
||||
return availableRefund
|
||||
}
|
||||
return refund
|
||||
}
|
||||
|
||||
// RefundGas transfers the leftover gas to the sender of the message, caped to half of the total gas
|
||||
// consumed in the transaction. Additionally, the function sets the total gas consumed to the value
|
||||
// returned by the EVM execution, thus ignoring the previous intrinsic gas consumed during in the
|
||||
@@ -271,13 +282,7 @@ func (k *Keeper) RefundGas(msg core.Message, leftoverGas uint64) (uint64, error)
|
||||
}
|
||||
|
||||
gasConsumed := msg.Gas() - leftoverGas
|
||||
|
||||
// Apply refund counter, capped to half of the used gas.
|
||||
refund := gasConsumed / 2
|
||||
availableRefund := k.GetRefund()
|
||||
if refund > availableRefund {
|
||||
refund = availableRefund
|
||||
}
|
||||
refund := k.GasToRefund(gasConsumed)
|
||||
|
||||
leftoverGas += refund
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
// copied from: https://github.com/ethereum/go-ethereum/blob/v1.10.3/internal/ethapi/api.go#L754
|
||||
|
||||
// CallArgs represents the arguments for a call.
|
||||
type CallArgs struct {
|
||||
From *common.Address `json:"from"`
|
||||
To *common.Address `json:"to"`
|
||||
Gas *hexutil.Uint64 `json:"gas"`
|
||||
GasPrice *hexutil.Big `json:"gasPrice"`
|
||||
Value *hexutil.Big `json:"value"`
|
||||
Data *hexutil.Bytes `json:"data"`
|
||||
AccessList *ethtypes.AccessList `json:"accessList"`
|
||||
}
|
||||
|
||||
// ToMessage converts CallArgs to the Message type used by the core evm
|
||||
func (args *CallArgs) ToMessage(globalGasCap uint64) ethtypes.Message {
|
||||
// Set sender address or use zero address if none specified.
|
||||
var addr common.Address
|
||||
if args.From != nil {
|
||||
addr = *args.From
|
||||
}
|
||||
|
||||
// Set default gas & gas price if none were set
|
||||
gas := globalGasCap
|
||||
if gas == 0 {
|
||||
gas = uint64(math.MaxUint64 / 2)
|
||||
}
|
||||
if args.Gas != nil {
|
||||
gas = uint64(*args.Gas)
|
||||
}
|
||||
if globalGasCap != 0 && globalGasCap < gas {
|
||||
// log.Warn("Caller gas above allowance, capping", "requested", gas, "cap", globalGasCap)
|
||||
gas = globalGasCap
|
||||
}
|
||||
gasPrice := new(big.Int)
|
||||
if args.GasPrice != nil {
|
||||
gasPrice = args.GasPrice.ToInt()
|
||||
}
|
||||
value := new(big.Int)
|
||||
if args.Value != nil {
|
||||
value = args.Value.ToInt()
|
||||
}
|
||||
var data []byte
|
||||
if args.Data != nil {
|
||||
data = *args.Data
|
||||
}
|
||||
var accessList ethtypes.AccessList
|
||||
if args.AccessList != nil {
|
||||
accessList = *args.AccessList
|
||||
}
|
||||
|
||||
msg := ethtypes.NewMessage(addr, args.To, 0, value, gas, gasPrice, data, accessList, false)
|
||||
return msg
|
||||
}
|
||||
|
||||
// String return the struct in a string format
|
||||
func (args *CallArgs) String() string {
|
||||
// Todo: There is currently a bug with hexutil.Big when the value its nil, printing would trigger an exception
|
||||
return fmt.Sprintf("CallArgs{From:%v, To:%v, Gas:%v,"+
|
||||
" Data:%v, AccessList:%v}",
|
||||
args.From,
|
||||
args.To,
|
||||
args.Gas,
|
||||
args.Data,
|
||||
args.AccessList)
|
||||
}
|
||||
+292
-77
@@ -1085,7 +1085,7 @@ func (m *QueryStaticCallRequest) GetInput() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// // QueryStaticCallRequest defines static call response
|
||||
// QueryStaticCallRequest defines static call response
|
||||
type QueryStaticCallResponse struct {
|
||||
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
@@ -1130,6 +1130,52 @@ func (m *QueryStaticCallResponse) GetData() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// EthCallRequest defines EthCall request
|
||||
type EthCallRequest struct {
|
||||
// same json format as the json rpc api.
|
||||
Args []byte `protobuf:"bytes,1,opt,name=args,proto3" json:"args,omitempty"`
|
||||
}
|
||||
|
||||
func (m *EthCallRequest) Reset() { *m = EthCallRequest{} }
|
||||
func (m *EthCallRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*EthCallRequest) ProtoMessage() {}
|
||||
func (*EthCallRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8bbc79ec2b6c5cb2, []int{24}
|
||||
}
|
||||
func (m *EthCallRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *EthCallRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_EthCallRequest.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *EthCallRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EthCallRequest.Merge(m, src)
|
||||
}
|
||||
func (m *EthCallRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *EthCallRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EthCallRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EthCallRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *EthCallRequest) GetArgs() []byte {
|
||||
if m != nil {
|
||||
return m.Args
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryAccountRequest)(nil), "ethermint.evm.v1alpha1.QueryAccountRequest")
|
||||
proto.RegisterType((*QueryAccountResponse)(nil), "ethermint.evm.v1alpha1.QueryAccountResponse")
|
||||
@@ -1155,6 +1201,7 @@ func init() {
|
||||
proto.RegisterType((*QueryChainConfigResponse)(nil), "ethermint.evm.v1alpha1.QueryChainConfigResponse")
|
||||
proto.RegisterType((*QueryStaticCallRequest)(nil), "ethermint.evm.v1alpha1.QueryStaticCallRequest")
|
||||
proto.RegisterType((*QueryStaticCallResponse)(nil), "ethermint.evm.v1alpha1.QueryStaticCallResponse")
|
||||
proto.RegisterType((*EthCallRequest)(nil), "ethermint.evm.v1alpha1.EthCallRequest")
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -1162,82 +1209,85 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_8bbc79ec2b6c5cb2 = []byte{
|
||||
// 1188 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xcd, 0x6f, 0x1b, 0xc5,
|
||||
0x1b, 0xc7, 0xbd, 0x89, 0xe3, 0x24, 0x4f, 0x92, 0xfe, 0xf2, 0x1b, 0x4c, 0x49, 0xb7, 0xc5, 0x09,
|
||||
0x5b, 0x9a, 0x38, 0x2f, 0xdd, 0x8d, 0xcd, 0x5b, 0xa9, 0x90, 0x20, 0x89, 0x14, 0x2a, 0xb5, 0x42,
|
||||
0xc5, 0xa9, 0x38, 0x20, 0x21, 0x6b, 0xbc, 0x5e, 0xd6, 0x56, 0xd6, 0x3b, 0xee, 0xee, 0xda, 0x4a,
|
||||
0x14, 0xe5, 0xc2, 0x01, 0x81, 0xe0, 0x00, 0xe2, 0x00, 0x42, 0x02, 0xf5, 0xca, 0x8d, 0x7f, 0x81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f1, 0x89, 0x24, 0x9b, 0x49, 0x15, 0x5c, 0xa0, 0x84, 0xea, 0xd6, 0x78,
|
||||
0xc6, 0x12, 0x42, 0x2b, 0x7d, 0xf2, 0xeb, 0x9f, 0xdf, 0x4c, 0x6c, 0x92, 0x75, 0x23, 0x41, 0x79,
|
||||
0xf1, 0xe1, 0x34, 0x4e, 0xb0, 0xce, 0x53, 0xf2, 0xb3, 0x02, 0x0b, 0x31, 0x6d, 0x22, 0xa5, 0x91,
|
||||
0x29, 0x2f, 0x52, 0x42, 0xb5, 0x7c, 0x19, 0x17, 0x64, 0xbd, 0x23, 0x58, 0xcb, 0x64, 0x3b, 0x89,
|
||||
0x35, 0x14, 0xc6, 0x21, 0xe4, 0x5f, 0x14, 0x58, 0x1c, 0x14, 0x1e, 0xf2, 0xea, 0x48, 0x84, 0x04,
|
||||
0xd5, 0x53, 0x5f, 0xbb, 0xa4, 0x17, 0xb2, 0xbf, 0x23, 0xd8, 0xef, 0x92, 0x3b, 0x49, 0xec, 0xdd,
|
||||
0xd0, 0xb3, 0x8f, 0x1f, 0x55, 0xd7, 0x53, 0xf2, 0x9d, 0x02, 0xd3, 0x28, 0x3a, 0x29, 0x03, 0x11,
|
||||
0x57, 0xb5, 0x94, 0x81, 0x18, 0xd0, 0x31, 0xad, 0x2c, 0x40, 0xb7, 0xc8, 0x46, 0x12, 0x28, 0xca,
|
||||
0x9a, 0x1f, 0x39, 0xde, 0x1f, 0x14, 0x98, 0x46, 0x41, 0x4a, 0x41, 0x8b, 0x6b, 0x60, 0x0a, 0xda,
|
||||
0x80, 0xc6, 0x69, 0x6f, 0x08, 0xb4, 0x12, 0x31, 0x92, 0xd0, 0x7c, 0xe9, 0xd0, 0x27, 0x33, 0x4e,
|
||||
0x0e, 0xad, 0xe3, 0x53, 0xf2, 0xa5, 0x02, 0x59, 0x2e, 0x65, 0xa4, 0x98, 0x32, 0x75, 0x3d, 0x95,
|
||||
0x54, 0xd7, 0xc7, 0xb0, 0x44, 0x2c, 0x43, 0x60, 0xad, 0x93, 0xb5, 0xe4, 0xb1, 0xac, 0xc7, 0x8e,
|
||||
0xeb, 0x6b, 0x05, 0x72, 0x52, 0xfc, 0xc8, 0xc6, 0xc8, 0x34, 0x31, 0x55, 0x55, 0x37, 0xc7, 0xb2,
|
||||
0x45, 0x28, 0x5d, 0x40, 0x15, 0xc9, 0x6a, 0x12, 0x14, 0x0a, 0x94, 0x71, 0xc2, 0xe5, 0x51, 0xb4,
|
||||
0x70, 0xb6, 0x27, 0x64, 0xe4, 0xf6, 0xe8, 0x91, 0x19, 0x10, 0x5c, 0x55, 0x1f, 0xd7, 0x7c, 0xdc,
|
||||
0x47, 0xa7, 0xc6, 0x5d, 0x62, 0x7c, 0xdf, 0x2b, 0x00, 0x7d, 0x8d, 0x22, 0x63, 0x64, 0x8c, 0xca,
|
||||
0x9c, 0x6a, 0x8c, 0x6d, 0x8f, 0x88, 0x9b, 0x02, 0xf1, 0x16, 0xb9, 0x39, 0x1a, 0x51, 0x68, 0x22,
|
||||
0xf9, 0x5c, 0x81, 0x9c, 0x54, 0xb0, 0x94, 0x86, 0xc6, 0x44, 0x33, 0xa5, 0xa1, 0x71, 0x29, 0xd5,
|
||||
0x56, 0x05, 0xd0, 0x0a, 0x29, 0x24, 0x01, 0x49, 0xd1, 0x24, 0x3f, 0x2a, 0x30, 0x17, 0x11, 0x36,
|
||||
0x32, 0xba, 0xf2, 0x61, 0x69, 0x55, 0xb7, 0xc7, 0x77, 0x40, 0xb4, 0x2d, 0x81, 0xb6, 0x4a, 0x5e,
|
||||
0x4e, 0xbc, 0x00, 0xdc, 0xa9, 0x2a, 0xb5, 0x55, 0x74, 0xb2, 0xaf, 0x86, 0x29, 0x9d, 0x1c, 0x12,
|
||||
0xe0, 0x94, 0x4e, 0x0e, 0xcb, 0x6c, 0x7a, 0x27, 0x7d, 0xe1, 0x53, 0x35, 0xa9, 0xe3, 0xec, 0xee,
|
||||
0x3e, 0x3d, 0x2b, 0x28, 0xcf, 0xce, 0x0a, 0xca, 0x1f, 0x67, 0x05, 0xe5, 0xab, 0xf3, 0x42, 0xe6,
|
||||
0xd9, 0x79, 0x21, 0xf3, 0xdb, 0x79, 0x21, 0xf3, 0x61, 0xd1, 0x6e, 0x06, 0x8d, 0x4e, 0x4d, 0x37,
|
||||
0x59, 0xcb, 0x08, 0x1a, 0xd4, 0xf3, 0x9b, 0x7e, 0x24, 0xe0, 0x91, 0x08, 0x19, 0x1c, 0xb7, 0x2d,
|
||||
0xbf, 0x96, 0x13, 0x7f, 0x54, 0x5f, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xcb, 0x23, 0x24,
|
||||
0x68, 0x0f, 0x00, 0x00,
|
||||
// 1247 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x4d, 0x6f, 0x1b, 0x45,
|
||||
0x18, 0xc7, 0xbd, 0xad, 0x63, 0x27, 0x4f, 0x92, 0x12, 0x06, 0x53, 0xd2, 0x6d, 0x71, 0xc2, 0xb4,
|
||||
0x4d, 0x9c, 0x97, 0xee, 0xc6, 0xe6, 0xad, 0x54, 0x48, 0x90, 0x44, 0x0d, 0x95, 0x5a, 0x50, 0x71,
|
||||
0x22, 0x0e, 0x48, 0xc8, 0x1a, 0xaf, 0x97, 0xb5, 0x15, 0x7b, 0xc7, 0xdd, 0x59, 0x5b, 0x89, 0xa2,
|
||||
0x5c, 0x38, 0x20, 0x28, 0x1c, 0x40, 0x1c, 0x40, 0x48, 0xa0, 0x5e, 0xb9, 0xf1, 0x15, 0xb8, 0xf5,
|
||||
0x58, 0x89, 0x0b, 0x27, 0x84, 0x12, 0x0e, 0x7c, 0x0c, 0x34, 0x2f, 0x6b, 0xef, 0xda, 0x59, 0xaf,
|
||||
0x83, 0xb8, 0xed, 0xcc, 0x3c, 0x2f, 0xbf, 0x67, 0x9e, 0x99, 0xf9, 0xdb, 0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x57, 0xea, 0x84, 0xd5, 0xe7, 0x2f,
|
||||
0x88, 0xb5, 0x49, 0x3e, 0x71, 0x8f, 0xb0, 0x3a, 0xca, 0xc1, 0x84, 0x4b, 0xb9, 0xd3, 0xc5, 0x45,
|
||||
0xad, 0x90, 0x2e, 0xcb, 0x01, 0x7e, 0x07, 0xae, 0x88, 0x24, 0xdb, 0x62, 0xcf, 0xfe, 0x03, 0xe5,
|
||||
0xe7, 0x1a, 0xe8, 0x67, 0x45, 0x50, 0xb0, 0x37, 0xe1, 0x92, 0x6c, 0x47, 0x25, 0x1a, 0x69, 0x56,
|
||||
0xce, 0x6e, 0xca, 0x49, 0xa4, 0xc3, 0x24, 0xe3, 0x49, 0x39, 0xdf, 0x05, 0xc1, 0xd7, 0x1b, 0xf3,
|
||||
0x10, 0x44, 0x46, 0xad, 0xb8, 0x9d, 0x56, 0xd5, 0xf6, 0x54, 0x05, 0xb3, 0x6a, 0xf6, 0x03, 0x31,
|
||||
0x89, 0xef, 0xc3, 0x35, 0xc1, 0xf1, 0x11, 0x69, 0x36, 0x6a, 0xc4, 0xa7, 0xde, 0x40, 0x31, 0xaf,
|
||||
0xc0, 0x8c, 0x45, 0xdd, 0x41, 0x8e, 0x69, 0x3e, 0xb7, 0x39, 0x54, 0xd5, 0x57, 0x1a, 0xbc, 0x1c,
|
||||
0x13, 0x4d, 0x15, 0xb6, 0x0c, 0xcf, 0x05, 0x54, 0xd1, 0x88, 0x01, 0xec, 0xff, 0x58, 0x5a, 0x70,
|
||||
0x88, 0xb6, 0x64, 0x9f, 0xcf, 0xd3, 0x9e, 0x0d, 0x75, 0x88, 0x7a, 0xae, 0x49, 0x87, 0x08, 0xdf,
|
||||
0x57, 0xc9, 0x76, 0x7d, 0xea, 0x11, 0x27, 0x39, 0x19, 0x9a, 0x83, 0x8b, 0xfb, 0xf6, 0xa1, 0x3a,
|
||||
0x6f, 0xfc, 0x33, 0x94, 0x7e, 0x5d, 0xa5, 0xef, 0x05, 0x53, 0xe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54, 0x5c, 0xfc, 0xec, 0xf7, 0xbf, 0xbf, 0xbb, 0xb0, 0x86, 0x56,
|
||||
0xcc, 0x18, 0x79, 0x56, 0xcf, 0xab, 0x79, 0xa4, 0x76, 0xe3, 0x18, 0xfd, 0xaa, 0xc1, 0x6c, 0x44,
|
||||
0xc1, 0x50, 0x71, 0x64, 0xca, 0xb3, 0xf4, 0x52, 0x2f, 0x9d, 0xc7, 0x45, 0xb1, 0xde, 0x16, 0xac,
|
||||
0x25, 0xb4, 0x11, 0xc7, 0x1a, 0xc8, 0xe7, 0x10, 0xf2, 0x6f, 0x1a, 0xcc, 0x0d, 0xca, 0x13, 0x7a,
|
||||
0x6d, 0x24, 0x42, 0x8c, 0x36, 0xea, 0xaf, 0x9f, 0xd3, 0x4b, 0xb1, 0xbf, 0x2b, 0xd8, 0xef, 0xa0,
|
||||
0xdb, 0x71, 0xec, 0xdd, 0xc0, 0xb3, 0x8f, 0x1f, 0xd6, 0xe0, 0x63, 0xf4, 0x83, 0x06, 0x59, 0x25,
|
||||
0x4d, 0x09, 0x07, 0x22, 0xaa, 0x7d, 0x09, 0x07, 0x62, 0x40, 0xed, 0x70, 0x49, 0x80, 0xae, 0xa3,
|
||||
0xd5, 0x38, 0x50, 0x25, 0x7e, 0x2c, 0xb4, 0xbd, 0x3f, 0x69, 0x90, 0x55, 0xb2, 0x95, 0x80, 0x16,
|
||||
0x55, 0xca, 0x04, 0xb4, 0x01, 0x25, 0xc4, 0x6f, 0x0a, 0xb4, 0x22, 0x32, 0xe3, 0xd0, 0x98, 0x74,
|
||||
0xe8, 0x93, 0x99, 0x47, 0xfb, 0xf6, 0xe1, 0x31, 0xfa, 0x5a, 0x83, 0x34, 0x17, 0x3c, 0x54, 0x48,
|
||||
0x38, 0x75, 0x3d, 0x2d, 0xd5, 0x57, 0xc6, 0xb0, 0x54, 0x58, 0xa6, 0xc0, 0x5a, 0x41, 0xcb, 0xf1,
|
||||
0xc7, 0xb2, 0x16, 0xd9, 0xae, 0x6f, 0x35, 0xc8, 0x48, 0x89, 0x44, 0xab, 0x23, 0xd3, 0x44, 0xb4,
|
||||
0x57, 0x5f, 0x1b, 0xcb, 0x56, 0x41, 0x19, 0x02, 0xaa, 0x80, 0x96, 0xcc, 0xd8, 0x9f, 0xdd, 0x42,
|
||||
0xc6, 0xcc, 0x23, 0x2e, 0xa2, 0xa2, 0x85, 0x53, 0x3d, 0xb9, 0x43, 0xb7, 0x46, 0x1f, 0x99, 0x01,
|
||||
0x59, 0xd6, 0x8d, 0x71, 0xcd, 0xc7, 0x7d, 0x74, 0xaa, 0xdc, 0x25, 0xc2, 0xf7, 0xa3, 0x06, 0xd0,
|
||||
0x57, 0x32, 0x34, 0x46, 0xc6, 0xb0, 0x18, 0xea, 0xe6, 0xd8, 0xf6, 0x0a, 0x71, 0x4d, 0x20, 0xde,
|
||||
0x44, 0xd7, 0x47, 0x23, 0x0a, 0xe5, 0x44, 0x5f, 0x6a, 0x90, 0x91, 0x3a, 0x97, 0xd0, 0xd0, 0x88,
|
||||
0xb4, 0x26, 0x34, 0x34, 0x2a, 0xb8, 0x78, 0x49, 0x00, 0x2d, 0xa2, 0x7c, 0x1c, 0x90, 0x94, 0x56,
|
||||
0xf4, 0xb3, 0x06, 0xd3, 0x21, 0xf9, 0x43, 0xa3, 0x2b, 0x1f, 0x16, 0x60, 0x7d, 0x63, 0x7c, 0x07,
|
||||
0x85, 0xb6, 0x2e, 0xd0, 0x96, 0xd0, 0x8d, 0xd8, 0x0b, 0xc0, 0x9d, 0x2a, 0x52, 0x81, 0x45, 0x27,
|
||||
0xfb, 0x9a, 0x99, 0xd0, 0xc9, 0x21, 0x99, 0x4e, 0xe8, 0xe4, 0xb0, 0x18, 0x27, 0x77, 0x92, 0x09,
|
||||
0x9f, 0x8a, 0xc5, 0x69, 0x1e, 0x6b, 0x90, 0x55, 0x32, 0x8d, 0x96, 0xe2, 0x32, 0x45, 0x75, 0x5c,
|
||||
0x8f, 0xbd, 0x2c, 0xef, 0x33, 0xe7, 0x2e, 0x5f, 0xb1, 0x3b, 0xad, 0xbd, 0x83, 0x1e, 0x4f, 0x41,
|
||||
0xf0, 0x60, 0xb4, 0x18, 0xc7, 0x63, 0xfb, 0x75, 0x01, 0xb3, 0xb5, 0xf5, 0xf4, 0x24, 0xaf, 0x3d,
|
||||
0x3b, 0xc9, 0x6b, 0x7f, 0x9d, 0xe4, 0xb5, 0x6f, 0x4e, 0xf3, 0xa9, 0x67, 0xa7, 0xf9, 0xd4, 0x1f,
|
||||
0xa7, 0xf9, 0xd4, 0xc7, 0x05, 0xa7, 0xe1, 0xd7, 0x3b, 0x55, 0xc3, 0xa2, 0x2d, 0xd3, 0xaf, 0x13,
|
||||
0x8f, 0x35, 0x58, 0x28, 0xda, 0x81, 0x88, 0xe7, 0x1f, 0xb6, 0x6d, 0x56, 0xcd, 0x88, 0xff, 0xd6,
|
||||
0xaf, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x31, 0x90, 0x2b, 0x28, 0x3c, 0x10, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -1277,6 +1327,8 @@ type QueryClient interface {
|
||||
ChainConfig(ctx context.Context, in *QueryChainConfigRequest, opts ...grpc.CallOption) (*QueryChainConfigResponse, error)
|
||||
// StaticCall queries the static call value of x/evm module.
|
||||
StaticCall(ctx context.Context, in *QueryStaticCallRequest, opts ...grpc.CallOption) (*QueryStaticCallResponse, error)
|
||||
// EthCall implements the `eth_call` rpc api
|
||||
EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
@@ -1395,6 +1447,15 @@ func (c *queryClient) StaticCall(ctx context.Context, in *QueryStaticCallRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) {
|
||||
out := new(MsgEthereumTxResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/EthCall", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
type QueryServer interface {
|
||||
// Account queries an Ethereum account.
|
||||
@@ -1422,6 +1483,8 @@ type QueryServer interface {
|
||||
ChainConfig(context.Context, *QueryChainConfigRequest) (*QueryChainConfigResponse, error)
|
||||
// StaticCall queries the static call value of x/evm module.
|
||||
StaticCall(context.Context, *QueryStaticCallRequest) (*QueryStaticCallResponse, error)
|
||||
// EthCall implements the `eth_call` rpc api
|
||||
EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||
@@ -1464,6 +1527,9 @@ func (*UnimplementedQueryServer) ChainConfig(ctx context.Context, req *QueryChai
|
||||
func (*UnimplementedQueryServer) StaticCall(ctx context.Context, req *QueryStaticCallRequest) (*QueryStaticCallResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StaticCall not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) EthCall(ctx context.Context, req *EthCallRequest) (*MsgEthereumTxResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EthCall not implemented")
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||
s.RegisterService(&_Query_serviceDesc, srv)
|
||||
@@ -1685,6 +1751,24 @@ func _Query_StaticCall_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_EthCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EthCallRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).EthCall(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethermint.evm.v1alpha1.Query/EthCall",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).EthCall(ctx, req.(*EthCallRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethermint.evm.v1alpha1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
@@ -1737,6 +1821,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "StaticCall",
|
||||
Handler: _Query_StaticCall_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EthCall",
|
||||
Handler: _Query_EthCall_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ethermint/evm/v1alpha1/query.proto",
|
||||
@@ -2531,6 +2619,36 @@ func (m *QueryStaticCallResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *EthCallRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *EthCallRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *EthCallRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Args) > 0 {
|
||||
i -= len(m.Args)
|
||||
copy(dAtA[i:], m.Args)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Args)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovQuery(v)
|
||||
base := offset
|
||||
@@ -2877,6 +2995,19 @@ func (m *QueryStaticCallResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *EthCallRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Args)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovQuery(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -5032,6 +5163,90 @@ func (m *QueryStaticCallResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *EthCallRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: EthCallRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: EthCallRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Args = append(m.Args[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Args == nil {
|
||||
m.Args = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipQuery(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -593,6 +593,42 @@ func local_request_Query_StaticCall_0(ctx context.Context, marshaler runtime.Mar
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_EthCall_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Query_EthCall_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq EthCallRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EthCall_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.EthCall(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_EthCall_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq EthCallRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EthCall_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.EthCall(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||
// UnaryRPC :call QueryServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
@@ -839,6 +875,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_EthCall_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_EthCall_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1120,6 +1176,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_EthCall_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_EthCall_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_EthCall_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1147,6 +1223,8 @@ var (
|
||||
pattern_Query_ChainConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "chain_config"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Query_StaticCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "static_call"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Query_EthCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "eth_call"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -1173,4 +1251,6 @@ var (
|
||||
forward_Query_ChainConfig_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_StaticCall_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_EthCall_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user