mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
d0123f52fd
* created starknet_call method * updated erigon lib * updated erigon lib * lint issues
35 lines
1002 B
Go
35 lines
1002 B
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
"github.com/ledgerwatch/erigon-lib/gointerfaces/starknet"
|
|
"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)
|
|
Call(ctx context.Context, request StarknetCallRequest, blockNrOrHash rpc.BlockNumberOrHash) ([]string, error)
|
|
}
|
|
|
|
type StarknetImpl struct {
|
|
*BaseAPI
|
|
db kv.RoDB
|
|
client starknet.CAIROVMClient
|
|
txPool txpool.TxpoolClient
|
|
}
|
|
|
|
func NewStarknetAPI(base *BaseAPI, db kv.RoDB, client starknet.CAIROVMClient, txPool txpool.TxpoolClient) *StarknetImpl {
|
|
return &StarknetImpl{
|
|
BaseAPI: base,
|
|
db: db,
|
|
client: client,
|
|
txPool: txPool,
|
|
}
|
|
}
|