api: ethrpc: fix eth_getCode, eth_getTransactionReceipt (#9530)

This commit is contained in:
Kevin Li
2022-11-09 19:40:00 +02:00
committed by vyzo
parent 56b238980b
commit e17e92775c
5 changed files with 31 additions and 19 deletions
+1 -1
View File
@@ -778,7 +778,7 @@ type FullNode interface {
EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash EthHash, txIndex EthUint64) (EthTx, error) //perm:read
EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum EthUint64, txIndex EthUint64) (EthTx, error) //perm:read
EthGetCode(ctx context.Context, address EthAddress) (EthBytes, error) //perm:read
EthGetCode(ctx context.Context, address EthAddress, blkOpt string) (EthBytes, error) //perm:read
EthGetStorageAt(ctx context.Context, address EthAddress, position EthBytes, blkParam string) (EthBytes, error) //perm:read
EthGetBalance(ctx context.Context, address EthAddress, blkParam string) (EthBigInt, error) //perm:read
EthChainId(ctx context.Context) (EthUint64, error) //perm:read
+4 -4
View File
@@ -1087,18 +1087,18 @@ func (mr *MockFullNodeMockRecorder) EthGetBlockTransactionCountByNumber(arg0, ar
}
// EthGetCode mocks base method.
func (m *MockFullNode) EthGetCode(arg0 context.Context, arg1 api.EthAddress) (api.EthBytes, error) {
func (m *MockFullNode) EthGetCode(arg0 context.Context, arg1 api.EthAddress, arg2 string) (api.EthBytes, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EthGetCode", arg0, arg1)
ret := m.ctrl.Call(m, "EthGetCode", arg0, arg1, arg2)
ret0, _ := ret[0].(api.EthBytes)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// EthGetCode indicates an expected call of EthGetCode.
func (mr *MockFullNodeMockRecorder) EthGetCode(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockFullNodeMockRecorder) EthGetCode(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetCode", reflect.TypeOf((*MockFullNode)(nil).EthGetCode), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthGetCode", reflect.TypeOf((*MockFullNode)(nil).EthGetCode), arg0, arg1, arg2)
}
// EthGetStorageAt mocks base method.
+4 -4
View File
@@ -242,7 +242,7 @@ type FullNodeStruct struct {
EthGetBlockTransactionCountByNumber func(p0 context.Context, p1 EthUint64) (EthUint64, error) `perm:"read"`
EthGetCode func(p0 context.Context, p1 EthAddress) (EthBytes, error) `perm:"read"`
EthGetCode func(p0 context.Context, p1 EthAddress, p2 string) (EthBytes, error) `perm:"read"`
EthGetStorageAt func(p0 context.Context, p1 EthAddress, p2 EthBytes, p3 string) (EthBytes, error) `perm:"read"`
@@ -1960,14 +1960,14 @@ func (s *FullNodeStub) EthGetBlockTransactionCountByNumber(p0 context.Context, p
return *new(EthUint64), ErrNotSupported
}
func (s *FullNodeStruct) EthGetCode(p0 context.Context, p1 EthAddress) (EthBytes, error) {
func (s *FullNodeStruct) EthGetCode(p0 context.Context, p1 EthAddress, p2 string) (EthBytes, error) {
if s.Internal.EthGetCode == nil {
return *new(EthBytes), ErrNotSupported
}
return s.Internal.EthGetCode(p0, p1)
return s.Internal.EthGetCode(p0, p1, p2)
}
func (s *FullNodeStub) EthGetCode(p0 context.Context, p1 EthAddress) (EthBytes, error) {
func (s *FullNodeStub) EthGetCode(p0 context.Context, p1 EthAddress, p2 string) (EthBytes, error) {
return *new(EthBytes), ErrNotSupported
}