erigon-pulse/cmd/rpcdaemon/commands/starknet_api.go
Alexandr Borodulin bbb3cc978f
Starknet getcode (#3038)
* deploy_cairo_smartcontract

* deploy_cairo_smartcontract / 2

Add new transaction type for cairo and vm factory

* starknet_getcode

* deploy_cairo_smartcontract / 3

* deploy_cairo_smartcontract / 4

* deploy_cairo_smartcontract / 5

Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2021-12-06 14:58:53 +00:00

31 lines
751 B
Go

package commands
import (
"context"
"github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
"github.com/ledgerwatch/erigon/common/hexutil"
"github.com/ledgerwatch/erigon/rpc"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/common"
)
type StarknetAPI interface {
SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
}
type StarknetImpl struct {
*BaseAPI
txPool txpool.TxpoolClient
db kv.RoDB
}
func NewStarknetAPI(base *BaseAPI, db kv.RoDB, txPool txpool.TxpoolClient) *StarknetImpl {
return &StarknetImpl{
BaseAPI: base,
db: db,
txPool: txPool,
}
}