func (m *RequestManager) GetCode(
	ctx context.Context,
	req GetCodeRequest,
) (GetCodeResponse, errors.Err) {
	if len(req.Address) == 0 {
		return GetCodeResponse{}, errors.New(errors.ErrInvalidAddress, nil)
	}
	return m.client.GetCode(ctx, req)
}
GetCode retrieves the source code for a specific service
package core
import (
	"context"
	stderr "errors"
	"fmt"
	ethereum "github.com/ethereum/go-ethereum/common"
	"github.com/oasislabs/oasis-gateway/errors"
	"github.com/oasislabs/oasis-gateway/log"
	mqueue "github.com/oasislabs/oasis-gateway/mqueue/core"
	"github.com/oasislabs/oasis-gateway/rpc"
	"github.com/oasislabs/oasis-gateway/stats"
)
type Client interface {
	Name() string
	Stats() stats.Metrics
	Senders() []ethereum.Address
	GetCode(context.Context, GetCodeRequest) (GetCodeResponse, errors.Err)
	GetExpiry(context.Context, GetExpiryRequest) (GetExpiryResponse, errors.Err)
	GetPublicKey(context.Context, GetPublicKeyRequest) (GetPublicKeyResponse, errors.Err)
	ExecuteService(context.Context, uint64, ExecuteServiceRequest) (ExecuteServiceResponse, errors.Err)
	DeployService(context.Context, uint64, DeployServiceRequest) (DeployServiceResponse, errors.Err)
	SubscribeRequest(context.Context, CreateSubscriptionRequest, chan<- interface{}) errors.Err
	UnsubscribeRequest(context.Context, DestroySubscriptionRequest) errors.Err
}
type RequestManager struct {
	mqueue mqueue.MQueue
	client Client
	logger log.Logger
	subman *SubscriptionManager
}
func (m *RequestManager) Name() string {
	return "backend.core.RequestManager"
}
func (m *RequestManager) Stats() stats.Metrics {
	return stats.Metrics{
		"subscriptions": m.subman.Stats(),
	}
}
type RequestManagerProperties struct {
	MQueue mqueue.MQueue
	Client Client
	Logger log.Logger
}
func NewRequestManager(properties RequestManagerProperties) *RequestManager {
	if properties.MQueue == nil {
		panic("MQueue must be set")
	}
	if properties.Client == nil {
		panic("Client must be set")
	}
	if properties.Logger == nil {
		panic("Logger must be set")
	}
	return &RequestManager{
		mqueue: properties.MQueue,
		logger: properties.Logger,
		client: properties.Client,
		subman: NewSubscriptionManager(SubscriptionManagerProps{
			Context: context.Background(),
			Logger:  properties.Logger,
			MQueue:  properties.MQueue,
		}),
	}
}
func (m *RequestManager) Senders() []ethereum.Address {
	return m.client.Senders()
}