forked from NethermindEth/juno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstarknetdata.go
23 lines (20 loc) · 1.05 KB
/
starknetdata.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package starknetdata
import (
"context"
"github.com/NethermindEth/juno/core"
"github.com/NethermindEth/juno/core/felt"
)
// StarknetData defines the function which are required to retrieve Starknet's state
//
//go:generate mockgen -destination=../mocks/mock_starknetdata.go -package=mocks github.com/NethermindEth/juno/starknetdata StarknetData
type StarknetData interface {
BlockByNumber(ctx context.Context, blockNumber uint64) (*core.Block, error)
BlockLatest(ctx context.Context) (*core.Block, error)
BlockPending(ctx context.Context) (*core.Block, error)
Transaction(ctx context.Context, transactionHash *felt.Felt) (core.Transaction, error)
Class(ctx context.Context, classHash *felt.Felt) (core.Class, error)
StateUpdate(ctx context.Context, blockNumber uint64) (*core.StateUpdate, error)
StateUpdatePending(ctx context.Context) (*core.StateUpdate, error)
StateUpdateWithBlock(ctx context.Context, blockNumber uint64) (*core.StateUpdate, *core.Block, error)
StateUpdatePendingWithBlock(ctx context.Context) (*core.StateUpdate, *core.Block, error)
}