noderpc

package
v0.0.0-...-b1b3a06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: interface.go

Generated by this command:

mockgen -source=interface.go -destination=mock.go -package=noderpc -typed

Package noderpc is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidStatusCode = errors.New("invalid status code")
	ErrNodeRPCError      = errors.New("Node RPC error")
)

Errors

Functions

func IsNodeUnavailiableError

func IsNodeUnavailiableError(err error) bool

IsNodeUnavailiableError -

Types

type BalanceUpdate

type BalanceUpdate struct {
	Kind     string `json:"kind"`
	Contract string `json:"contract,omitempty"`
	Change   string `json:"change"`
	Origin   string `json:"origin"`
	Category string `json:"category,omitempty"`
	Delegate string `json:"delegate,omitempty"`
	Cycle    int64  `json:"cycle,omitempty"`
}

BalanceUpdate -

type BigMap

type BigMap struct {
	KeyType    *ast.TypedAst `json:"key_type"`
	ValueType  *ast.TypedAst `json:"value_type"`
	TotalBytes uint64        `json:"total_bytes,string"`
}

BigMap -

type BigMapDiff

type BigMapDiff struct {
	Action       string             `json:"action"`
	KeyHash      string             `json:"key_hash"`
	BigMap       *int64             `json:"big_map,omitempty,string"`
	SourceBigMap *int64             `json:"source_big_map,omitempty,string"`
	DestBigMap   *int64             `json:"destination_big_map,omitempty,string"`
	Key          stdJSON.RawMessage `json:"key"`
	Value        stdJSON.RawMessage `json:"value,omitempty"`
	KeyType      stdJSON.RawMessage `json:"key_type,omitempty"`
	ValueType    stdJSON.RawMessage `json:"value_type,omitempty"`
}

BigMapDiff -

type Block

type Block struct {
	ChainID  string `json:"chain_id"`
	Hash     string `json:"hash"`
	Protocol string `json:"protocol"`

	Header     Header                  `json:"header"`
	Metadata   *Metadata               `json:"metadata"`
	Operations [][]LightOperationGroup `json:"operations"`
}

Block -

type CipherText

type CipherText struct {
	CV         string `json:"cv"`
	EPK        string `json:"epk"`
	PayloadEnc string `json:"payload_enc"`
	NonceEnc   string `json:"nonce_enc"`
	PayloadOut string `json:"payload_out"`
	NonceOut   string `json:"nonce_out"`
}

CipherText -

type CommitmentsAndCiphertexts

type CommitmentsAndCiphertexts struct {
	Commitment string
	CipherText CipherText
}

CommitmentsAndCiphertexts -

func (*CommitmentsAndCiphertexts) UnmarshalJSON

func (c *CommitmentsAndCiphertexts) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type Constants

type Constants struct {
	CostPerByte                  int64            `json:"cost_per_byte,string"`
	HardGasLimitPerOperation     int64            `json:"hard_gas_limit_per_operation,string"`
	HardStorageLimitPerOperation int64            `json:"hard_storage_limit_per_operation,string"`
	TimeBetweenBlocks            Int64StringSlice `json:"time_between_blocks"`
	MinimalBlockDelay            *int64           `json:"minimal_block_delay,omitempty,string"`
}

Constants -

func (Constants) BlockDelay

func (c Constants) BlockDelay() int64

BlockDelay -

type ContractData

type ContractData struct {
	RawScript stdJSON.RawMessage `json:"script"`
	Balance   int64              `json:"balance,string"`
	Counter   int64              `json:"counter,string"`
	Manager   string             `json:"manager"`
	Delegate  Delegate           `json:"delegate"`
}

ContractData -

type Delegate

type Delegate struct {
	Value string `json:"value"`
}

func (*Delegate) UnmarshalJSON

func (d *Delegate) UnmarshalJSON(data []byte) error

type Diff

type Diff struct {
	BigMap       *LazyBigMapDiff
	SaplingState *LazySaplingStateDiff
}

Diff -

type Header struct {
	Level       int64     `json:"level"`
	Protocol    string    `json:"protocol"`
	Timestamp   time.Time `json:"timestamp"`
	ChainID     string    `json:"chain_id"`
	Hash        string    `json:"hash"`
	Predecessor string    `json:"predecessor"`
}

Header is a header in a block returned by the Tezos RPC API.

type INode

type INode interface {
	Block(context.Context, int64) (Block, error)
	BlockHash(context.Context, int64) (string, error)
	GetHead(context.Context) (Header, error)
	GetHeader(context.Context, int64) (Header, error)
	GetScriptJSON(context.Context, string, int64) (Script, error)
	GetRawScript(ctx context.Context, address string, level int64) ([]byte, error)
	GetScriptStorageRaw(context.Context, string, int64) ([]byte, error)
	GetContractBalance(context.Context, string, int64) (int64, error)
	GetContractData(context.Context, string, int64) (ContractData, error)
	GetOPG(ctx context.Context, block int64) ([]OperationGroup, error)
	GetLightOPG(ctx context.Context, block int64) ([]LightOperationGroup, error)
	GetContractsByBlock(context.Context, int64) ([]string, error)
	GetNetworkConstants(context.Context, int64) (Constants, error)
	RunCode(context.Context, []byte, []byte, []byte, string, string, string, string, string, int64, int64) (RunCodeResponse, error)
	RunOperation(context.Context, string, string, string, string, int64, int64, int64, int64, int64, []byte) (OperationGroup, error)
	RunOperationLight(context.Context, string, string, string, string, int64, int64, int64, int64, int64, []byte) (LightOperationGroup, error)
	RunScriptView(ctx context.Context, request RunScriptViewRequest) ([]byte, error)
	GetCounter(context.Context, string) (int64, error)
	GetBigMapType(ctx context.Context, ptr, level int64) (BigMap, error)
	GetBlockMetadata(ctx context.Context, level int64) (metadata Metadata, err error)
	GetLevel(ctx context.Context) (int64, error)
}

INode -

type INodeBlockCall

type INodeBlockCall struct {
	*gomock.Call
}

INodeBlockCall wrap *gomock.Call

func (*INodeBlockCall) Do

Do rewrite *gomock.Call.Do

func (*INodeBlockCall) DoAndReturn

func (c *INodeBlockCall) DoAndReturn(f func(context.Context, int64) (Block, error)) *INodeBlockCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeBlockCall) Return

func (c *INodeBlockCall) Return(arg0 Block, arg1 error) *INodeBlockCall

Return rewrite *gomock.Call.Return

type INodeBlockHashCall

type INodeBlockHashCall struct {
	*gomock.Call
}

INodeBlockHashCall wrap *gomock.Call

func (*INodeBlockHashCall) Do

Do rewrite *gomock.Call.Do

func (*INodeBlockHashCall) DoAndReturn

func (c *INodeBlockHashCall) DoAndReturn(f func(context.Context, int64) (string, error)) *INodeBlockHashCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeBlockHashCall) Return

func (c *INodeBlockHashCall) Return(arg0 string, arg1 error) *INodeBlockHashCall

Return rewrite *gomock.Call.Return

type INodeGetBigMapTypeCall

type INodeGetBigMapTypeCall struct {
	*gomock.Call
}

INodeGetBigMapTypeCall wrap *gomock.Call

func (*INodeGetBigMapTypeCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetBigMapTypeCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetBigMapTypeCall) Return

Return rewrite *gomock.Call.Return

type INodeGetBlockMetadataCall

type INodeGetBlockMetadataCall struct {
	*gomock.Call
}

INodeGetBlockMetadataCall wrap *gomock.Call

func (*INodeGetBlockMetadataCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetBlockMetadataCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetBlockMetadataCall) Return

Return rewrite *gomock.Call.Return

type INodeGetContractBalanceCall

type INodeGetContractBalanceCall struct {
	*gomock.Call
}

INodeGetContractBalanceCall wrap *gomock.Call

func (*INodeGetContractBalanceCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetContractBalanceCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetContractBalanceCall) Return

Return rewrite *gomock.Call.Return

type INodeGetContractDataCall

type INodeGetContractDataCall struct {
	*gomock.Call
}

INodeGetContractDataCall wrap *gomock.Call

func (*INodeGetContractDataCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetContractDataCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetContractDataCall) Return

Return rewrite *gomock.Call.Return

type INodeGetContractsByBlockCall

type INodeGetContractsByBlockCall struct {
	*gomock.Call
}

INodeGetContractsByBlockCall wrap *gomock.Call

func (*INodeGetContractsByBlockCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetContractsByBlockCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetContractsByBlockCall) Return

Return rewrite *gomock.Call.Return

type INodeGetCounterCall

type INodeGetCounterCall struct {
	*gomock.Call
}

INodeGetCounterCall wrap *gomock.Call

func (*INodeGetCounterCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetCounterCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetCounterCall) Return

func (c *INodeGetCounterCall) Return(arg0 int64, arg1 error) *INodeGetCounterCall

Return rewrite *gomock.Call.Return

type INodeGetHeadCall

type INodeGetHeadCall struct {
	*gomock.Call
}

INodeGetHeadCall wrap *gomock.Call

func (*INodeGetHeadCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetHeadCall) DoAndReturn

func (c *INodeGetHeadCall) DoAndReturn(f func(context.Context) (Header, error)) *INodeGetHeadCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetHeadCall) Return

func (c *INodeGetHeadCall) Return(arg0 Header, arg1 error) *INodeGetHeadCall

Return rewrite *gomock.Call.Return

type INodeGetHeaderCall

type INodeGetHeaderCall struct {
	*gomock.Call
}

INodeGetHeaderCall wrap *gomock.Call

func (*INodeGetHeaderCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetHeaderCall) DoAndReturn

func (c *INodeGetHeaderCall) DoAndReturn(f func(context.Context, int64) (Header, error)) *INodeGetHeaderCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetHeaderCall) Return

func (c *INodeGetHeaderCall) Return(arg0 Header, arg1 error) *INodeGetHeaderCall

Return rewrite *gomock.Call.Return

type INodeGetLevelCall

type INodeGetLevelCall struct {
	*gomock.Call
}

INodeGetLevelCall wrap *gomock.Call

func (*INodeGetLevelCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetLevelCall) DoAndReturn

func (c *INodeGetLevelCall) DoAndReturn(f func(context.Context) (int64, error)) *INodeGetLevelCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetLevelCall) Return

func (c *INodeGetLevelCall) Return(arg0 int64, arg1 error) *INodeGetLevelCall

Return rewrite *gomock.Call.Return

type INodeGetLightOPGCall

type INodeGetLightOPGCall struct {
	*gomock.Call
}

INodeGetLightOPGCall wrap *gomock.Call

func (*INodeGetLightOPGCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetLightOPGCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetLightOPGCall) Return

Return rewrite *gomock.Call.Return

type INodeGetNetworkConstantsCall

type INodeGetNetworkConstantsCall struct {
	*gomock.Call
}

INodeGetNetworkConstantsCall wrap *gomock.Call

func (*INodeGetNetworkConstantsCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetNetworkConstantsCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetNetworkConstantsCall) Return

Return rewrite *gomock.Call.Return

type INodeGetOPGCall

type INodeGetOPGCall struct {
	*gomock.Call
}

INodeGetOPGCall wrap *gomock.Call

func (*INodeGetOPGCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetOPGCall) DoAndReturn

func (c *INodeGetOPGCall) DoAndReturn(f func(context.Context, int64) ([]OperationGroup, error)) *INodeGetOPGCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetOPGCall) Return

func (c *INodeGetOPGCall) Return(arg0 []OperationGroup, arg1 error) *INodeGetOPGCall

Return rewrite *gomock.Call.Return

type INodeGetRawScriptCall

type INodeGetRawScriptCall struct {
	*gomock.Call
}

INodeGetRawScriptCall wrap *gomock.Call

func (*INodeGetRawScriptCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetRawScriptCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetRawScriptCall) Return

func (c *INodeGetRawScriptCall) Return(arg0 []byte, arg1 error) *INodeGetRawScriptCall

Return rewrite *gomock.Call.Return

type INodeGetScriptJSONCall

type INodeGetScriptJSONCall struct {
	*gomock.Call
}

INodeGetScriptJSONCall wrap *gomock.Call

func (*INodeGetScriptJSONCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetScriptJSONCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetScriptJSONCall) Return

Return rewrite *gomock.Call.Return

type INodeGetScriptStorageRawCall

type INodeGetScriptStorageRawCall struct {
	*gomock.Call
}

INodeGetScriptStorageRawCall wrap *gomock.Call

func (*INodeGetScriptStorageRawCall) Do

Do rewrite *gomock.Call.Do

func (*INodeGetScriptStorageRawCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeGetScriptStorageRawCall) Return

Return rewrite *gomock.Call.Return

type INodeRunCodeCall

type INodeRunCodeCall struct {
	*gomock.Call
}

INodeRunCodeCall wrap *gomock.Call

func (*INodeRunCodeCall) Do

Do rewrite *gomock.Call.Do

func (*INodeRunCodeCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeRunCodeCall) Return

func (c *INodeRunCodeCall) Return(arg0 RunCodeResponse, arg1 error) *INodeRunCodeCall

Return rewrite *gomock.Call.Return

type INodeRunOperationCall

type INodeRunOperationCall struct {
	*gomock.Call
}

INodeRunOperationCall wrap *gomock.Call

func (*INodeRunOperationCall) Do

Do rewrite *gomock.Call.Do

func (*INodeRunOperationCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeRunOperationCall) Return

Return rewrite *gomock.Call.Return

type INodeRunOperationLightCall

type INodeRunOperationLightCall struct {
	*gomock.Call
}

INodeRunOperationLightCall wrap *gomock.Call

func (*INodeRunOperationLightCall) Do

Do rewrite *gomock.Call.Do

func (*INodeRunOperationLightCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeRunOperationLightCall) Return

Return rewrite *gomock.Call.Return

type INodeRunScriptViewCall

type INodeRunScriptViewCall struct {
	*gomock.Call
}

INodeRunScriptViewCall wrap *gomock.Call

func (*INodeRunScriptViewCall) Do

Do rewrite *gomock.Call.Do

func (*INodeRunScriptViewCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*INodeRunScriptViewCall) Return

func (c *INodeRunScriptViewCall) Return(arg0 []byte, arg1 error) *INodeRunScriptViewCall

Return rewrite *gomock.Call.Return

type ImplicitOperationsResult

type ImplicitOperationsResult struct {
	Kind                string             `json:"kind"`
	BalanceUpdates      []BalanceUpdate    `json:"balance_updates"`
	OriginatedContracts []string           `json:"originated_contracts,omitempty"`
	StorageSize         int64              `json:"storage_size,string"`
	PaidStorageSizeDiff int64              `json:"paid_storage_size_diff,string"`
	Storage             stdJSON.RawMessage `json:"storage,omitempty"`
	ConsumedGas         int64              `json:"consumed_gas,string,omitempty"`
	ConsumedMilligas    int64              `json:"consumed_milligas,string,omitempty"`
}

ImplicitOperationsResult -

type Int64StringSlice

type Int64StringSlice []int64

Int64StringSlice -

func (*Int64StringSlice) UnmarshalJSON

func (slice *Int64StringSlice) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type InvalidNodeResponse

type InvalidNodeResponse struct {
	Errors []RunCodeError
	Raw    []byte
}

InvalidNodeResponse -

func (InvalidNodeResponse) Error

func (e InvalidNodeResponse) Error() string

Error -

func (InvalidNodeResponse) Is

func (e InvalidNodeResponse) Is(target error) bool

Is -

type LazyBigMapDiff

type LazyBigMapDiff struct {
	Action    string             `json:"action"`
	Updates   []LazyBigMapUpdate `json:"updates"`
	Source    *int64             `json:"source,omitempty,string"`
	KeyType   stdJSON.RawMessage `json:"key_type,omitempty"`
	ValueType stdJSON.RawMessage `json:"value_type,omitempty"`
}

LazyBigMapDiff -

type LazyBigMapUpdate

type LazyBigMapUpdate struct {
	KeyHash string             `json:"key_hash"`
	Key     stdJSON.RawMessage `json:"key"`
	Value   stdJSON.RawMessage `json:"value,omitempty"`
}

LazyBigMapUpdate -

type LazySaplingStateDiff

type LazySaplingStateDiff struct {
	Action   string                 `json:"action"`
	Updates  LazySaplingStateUpdate `json:"updates"`
	Source   *int64                 `json:"source,omitempty,string"`
	MemoSize *int64                 `json:"memo_size,omitempty"`
}

LazySaplingStateDiff -

type LazySaplingStateUpdate

type LazySaplingStateUpdate struct {
	CommitmentsAndCiphertexts []CommitmentsAndCiphertexts `json:"commitments_and_ciphertexts"`
	Nullifiers                []string                    `json:"nullifiers"`
}

LazyBigMapUpdate -

type LazyStorageDiff

type LazyStorageDiff struct {
	LazyStorageDiffKind
	Diff *Diff `json:"omitempty"`
}

LazyStorageDiff -

func (*LazyStorageDiff) UnmarshalJSON

func (lsd *LazyStorageDiff) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type LazyStorageDiffKind

type LazyStorageDiffKind struct {
	Kind string             `json:"kind"`
	ID   int64              `json:"id,string"`
	Raw  stdJSON.RawMessage `json:"diff,omitempty"`
}

LazyStorageDiffKind -

type LevelInfo

type LevelInfo struct {
	Level              int64 `json:"level"`
	LevelPosition      int64 `json:"level_position"`
	Cycle              int64 `json:"cycle"`
	CyclePosition      int64 `json:"cycle_position"`
	ExpectedCommitment bool  `json:"expected_commitment"`
}

LevelInfo -

type LightOperation

type LightOperation struct {
	Raw         stdJSON.RawMessage `json:"-"`
	Kind        string             `json:"kind"`
	Source      string             `json:"source"`
	Destination *string            `json:"destination,omitempty"`
}

LightOperation -

func (*LightOperation) UnmarshalJSON

func (op *LightOperation) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type LightOperationGroup

type LightOperationGroup struct {
	Protocol  string           `json:"protocol"`
	ChainID   string           `json:"chain_id"`
	Hash      string           `json:"hash"`
	Branch    string           `json:"branch"`
	Signature string           `json:"signature"`
	Contents  []LightOperation `json:"contents"`
}

LightOperationGroup -

type Metadata

type Metadata struct {
	Protocol        string `json:"protocol"`
	NextProtocol    string `json:"next_protocol"`
	TestChainStatus struct {
		Status string `json:"status"`
	} `json:"test_chain_status"`
	MaxOperationsTTL       int `json:"max_operations_ttl"`
	MaxOperationDataLength int `json:"max_operation_data_length"`
	MaxBlockHeaderLength   int `json:"max_block_header_length"`
	MaxOperationListLength []struct {
		MaxSize int `json:"max_size"`
		MaxOp   int `json:"max_op,omitempty"`
	} `json:"max_operation_list_length"`
	Baker            string    `json:"baker"`
	LevelInfo        LevelInfo `json:"level_info"`
	VotingPeriodInfo struct {
		VotingPeriod struct {
			Index         int    `json:"index"`
			Kind          string `json:"kind"`
			StartPosition int    `json:"start_position"`
		} `json:"voting_period"`
		Position  int `json:"position"`
		Remaining int `json:"remaining"`
	} `json:"voting_period_info"`
	NonceHash                 string                     `json:"nonce_hash"`
	ConsumedGas               string                     `json:"consumed_gas"`
	Deactivated               []interface{}              `json:"deactivated"`
	BalanceUpdates            []BalanceUpdate            `json:"balance_updates"`
	LiquidityBakingEscapeEma  int                        `json:"liquidity_baking_escape_ema"`
	ImplicitOperationsResults []ImplicitOperationsResult `json:"implicit_operations_results"`
}

Metadata -

type MockINode

type MockINode struct {
	// contains filtered or unexported fields
}

MockINode is a mock of INode interface.

func NewMockINode

func NewMockINode(ctrl *gomock.Controller) *MockINode

NewMockINode creates a new mock instance.

func (*MockINode) Block

func (m *MockINode) Block(arg0 context.Context, arg1 int64) (Block, error)

Block mocks base method.

func (*MockINode) BlockHash

func (m *MockINode) BlockHash(arg0 context.Context, arg1 int64) (string, error)

BlockHash mocks base method.

func (*MockINode) EXPECT

func (m *MockINode) EXPECT() *MockINodeMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockINode) GetBigMapType

func (m *MockINode) GetBigMapType(ctx context.Context, ptr, level int64) (BigMap, error)

GetBigMapType mocks base method.

func (*MockINode) GetBlockMetadata

func (m *MockINode) GetBlockMetadata(ctx context.Context, level int64) (Metadata, error)

GetBlockMetadata mocks base method.

func (*MockINode) GetContractBalance

func (m *MockINode) GetContractBalance(arg0 context.Context, arg1 string, arg2 int64) (int64, error)

GetContractBalance mocks base method.

func (*MockINode) GetContractData

func (m *MockINode) GetContractData(arg0 context.Context, arg1 string, arg2 int64) (ContractData, error)

GetContractData mocks base method.

func (*MockINode) GetContractsByBlock

func (m *MockINode) GetContractsByBlock(arg0 context.Context, arg1 int64) ([]string, error)

GetContractsByBlock mocks base method.

func (*MockINode) GetCounter

func (m *MockINode) GetCounter(arg0 context.Context, arg1 string) (int64, error)

GetCounter mocks base method.

func (*MockINode) GetHead

func (m *MockINode) GetHead(arg0 context.Context) (Header, error)

GetHead mocks base method.

func (*MockINode) GetHeader

func (m *MockINode) GetHeader(arg0 context.Context, arg1 int64) (Header, error)

GetHeader mocks base method.

func (*MockINode) GetLevel

func (m *MockINode) GetLevel(ctx context.Context) (int64, error)

GetLevel mocks base method.

func (*MockINode) GetLightOPG

func (m *MockINode) GetLightOPG(ctx context.Context, block int64) ([]LightOperationGroup, error)

GetLightOPG mocks base method.

func (*MockINode) GetNetworkConstants

func (m *MockINode) GetNetworkConstants(arg0 context.Context, arg1 int64) (Constants, error)

GetNetworkConstants mocks base method.

func (*MockINode) GetOPG

func (m *MockINode) GetOPG(ctx context.Context, block int64) ([]OperationGroup, error)

GetOPG mocks base method.

func (*MockINode) GetRawScript

func (m *MockINode) GetRawScript(ctx context.Context, address string, level int64) ([]byte, error)

GetRawScript mocks base method.

func (*MockINode) GetScriptJSON

func (m *MockINode) GetScriptJSON(arg0 context.Context, arg1 string, arg2 int64) (Script, error)

GetScriptJSON mocks base method.

func (*MockINode) GetScriptStorageRaw

func (m *MockINode) GetScriptStorageRaw(arg0 context.Context, arg1 string, arg2 int64) ([]byte, error)

GetScriptStorageRaw mocks base method.

func (*MockINode) RunCode

func (m *MockINode) RunCode(arg0 context.Context, arg1, arg2, arg3 []byte, arg4, arg5, arg6, arg7, arg8 string, arg9, arg10 int64) (RunCodeResponse, error)

RunCode mocks base method.

func (*MockINode) RunOperation

func (m *MockINode) RunOperation(arg0 context.Context, arg1, arg2, arg3, arg4 string, arg5, arg6, arg7, arg8, arg9 int64, arg10 []byte) (OperationGroup, error)

RunOperation mocks base method.

func (*MockINode) RunOperationLight

func (m *MockINode) RunOperationLight(arg0 context.Context, arg1, arg2, arg3, arg4 string, arg5, arg6, arg7, arg8, arg9 int64, arg10 []byte) (LightOperationGroup, error)

RunOperationLight mocks base method.

func (*MockINode) RunScriptView

func (m *MockINode) RunScriptView(ctx context.Context, request RunScriptViewRequest) ([]byte, error)

RunScriptView mocks base method.

type MockINodeMockRecorder

type MockINodeMockRecorder struct {
	// contains filtered or unexported fields
}

MockINodeMockRecorder is the mock recorder for MockINode.

func (*MockINodeMockRecorder) Block

func (mr *MockINodeMockRecorder) Block(arg0, arg1 any) *INodeBlockCall

Block indicates an expected call of Block.

func (*MockINodeMockRecorder) BlockHash

func (mr *MockINodeMockRecorder) BlockHash(arg0, arg1 any) *INodeBlockHashCall

BlockHash indicates an expected call of BlockHash.

func (*MockINodeMockRecorder) GetBigMapType

func (mr *MockINodeMockRecorder) GetBigMapType(ctx, ptr, level any) *INodeGetBigMapTypeCall

GetBigMapType indicates an expected call of GetBigMapType.

func (*MockINodeMockRecorder) GetBlockMetadata

func (mr *MockINodeMockRecorder) GetBlockMetadata(ctx, level any) *INodeGetBlockMetadataCall

GetBlockMetadata indicates an expected call of GetBlockMetadata.

func (*MockINodeMockRecorder) GetContractBalance

func (mr *MockINodeMockRecorder) GetContractBalance(arg0, arg1, arg2 any) *INodeGetContractBalanceCall

GetContractBalance indicates an expected call of GetContractBalance.

func (*MockINodeMockRecorder) GetContractData

func (mr *MockINodeMockRecorder) GetContractData(arg0, arg1, arg2 any) *INodeGetContractDataCall

GetContractData indicates an expected call of GetContractData.

func (*MockINodeMockRecorder) GetContractsByBlock

func (mr *MockINodeMockRecorder) GetContractsByBlock(arg0, arg1 any) *INodeGetContractsByBlockCall

GetContractsByBlock indicates an expected call of GetContractsByBlock.

func (*MockINodeMockRecorder) GetCounter

func (mr *MockINodeMockRecorder) GetCounter(arg0, arg1 any) *INodeGetCounterCall

GetCounter indicates an expected call of GetCounter.

func (*MockINodeMockRecorder) GetHead

func (mr *MockINodeMockRecorder) GetHead(arg0 any) *INodeGetHeadCall

GetHead indicates an expected call of GetHead.

func (*MockINodeMockRecorder) GetHeader

func (mr *MockINodeMockRecorder) GetHeader(arg0, arg1 any) *INodeGetHeaderCall

GetHeader indicates an expected call of GetHeader.

func (*MockINodeMockRecorder) GetLevel

func (mr *MockINodeMockRecorder) GetLevel(ctx any) *INodeGetLevelCall

GetLevel indicates an expected call of GetLevel.

func (*MockINodeMockRecorder) GetLightOPG

func (mr *MockINodeMockRecorder) GetLightOPG(ctx, block any) *INodeGetLightOPGCall

GetLightOPG indicates an expected call of GetLightOPG.

func (*MockINodeMockRecorder) GetNetworkConstants

func (mr *MockINodeMockRecorder) GetNetworkConstants(arg0, arg1 any) *INodeGetNetworkConstantsCall

GetNetworkConstants indicates an expected call of GetNetworkConstants.

func (*MockINodeMockRecorder) GetOPG

func (mr *MockINodeMockRecorder) GetOPG(ctx, block any) *INodeGetOPGCall

GetOPG indicates an expected call of GetOPG.

func (*MockINodeMockRecorder) GetRawScript

func (mr *MockINodeMockRecorder) GetRawScript(ctx, address, level any) *INodeGetRawScriptCall

GetRawScript indicates an expected call of GetRawScript.

func (*MockINodeMockRecorder) GetScriptJSON

func (mr *MockINodeMockRecorder) GetScriptJSON(arg0, arg1, arg2 any) *INodeGetScriptJSONCall

GetScriptJSON indicates an expected call of GetScriptJSON.

func (*MockINodeMockRecorder) GetScriptStorageRaw

func (mr *MockINodeMockRecorder) GetScriptStorageRaw(arg0, arg1, arg2 any) *INodeGetScriptStorageRawCall

GetScriptStorageRaw indicates an expected call of GetScriptStorageRaw.

func (*MockINodeMockRecorder) RunCode

func (mr *MockINodeMockRecorder) RunCode(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 any) *INodeRunCodeCall

RunCode indicates an expected call of RunCode.

func (*MockINodeMockRecorder) RunOperation

func (mr *MockINodeMockRecorder) RunOperation(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 any) *INodeRunOperationCall

RunOperation indicates an expected call of RunOperation.

func (*MockINodeMockRecorder) RunOperationLight

func (mr *MockINodeMockRecorder) RunOperationLight(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 any) *INodeRunOperationLightCall

RunOperationLight indicates an expected call of RunOperationLight.

func (*MockINodeMockRecorder) RunScriptView

func (mr *MockINodeMockRecorder) RunScriptView(ctx, request any) *INodeRunScriptViewCall

RunScriptView indicates an expected call of RunScriptView.

type NodeOption

type NodeOption func(*NodeRPC)

NodeOption -

func WithLog

func WithLog() NodeOption

WithLog -

func WithRateLimit

func WithRateLimit(requestPerSecond int) NodeOption

WithRateLimit -

func WithTimeout

func WithTimeout(timeout time.Duration) NodeOption

WithTimeout -

type NodeRPC

type NodeRPC struct {
	// contains filtered or unexported fields
}

NodeRPC -

func NewNodeRPC

func NewNodeRPC(baseURL string, opts ...NodeOption) *NodeRPC

NewNodeRPC -

func NewWaitNodeRPC

func NewWaitNodeRPC(baseURL string, opts ...NodeOption) *NodeRPC

NewWaitNodeRPC -

func (*NodeRPC) Block

func (rpc *NodeRPC) Block(ctx context.Context, level int64) (block Block, err error)

Block - returns block

func (*NodeRPC) BlockHash

func (rpc *NodeRPC) BlockHash(ctx context.Context, level int64) (hash string, err error)

BlockHash - returns block's hash, its unique identifier.

func (*NodeRPC) GetBigMapType

func (rpc *NodeRPC) GetBigMapType(ctx context.Context, ptr, level int64) (bm BigMap, err error)

GetBigMapType -

func (*NodeRPC) GetBlockMetadata

func (rpc *NodeRPC) GetBlockMetadata(ctx context.Context, level int64) (metadata Metadata, err error)

GetBlockMetadata -

func (*NodeRPC) GetContractBalance

func (rpc *NodeRPC) GetContractBalance(ctx context.Context, address string, level int64) (int64, error)

GetContractBalance -

func (*NodeRPC) GetContractData

func (rpc *NodeRPC) GetContractData(ctx context.Context, address string, level int64) (ContractData, error)

GetContractData -

func (*NodeRPC) GetContractsByBlock

func (rpc *NodeRPC) GetContractsByBlock(ctx context.Context, block int64) ([]string, error)

GetContractsByBlock -

func (*NodeRPC) GetCounter

func (rpc *NodeRPC) GetCounter(ctx context.Context, address string) (int64, error)

GetCounter -

func (*NodeRPC) GetHead

func (rpc *NodeRPC) GetHead(ctx context.Context) (Header, error)

GetHead - get head

func (*NodeRPC) GetHeader

func (rpc *NodeRPC) GetHeader(ctx context.Context, level int64) (header Header, err error)

GetHeader - get head for certain level

func (*NodeRPC) GetLevel

func (rpc *NodeRPC) GetLevel(ctx context.Context) (int64, error)

GetLevel - get head level

func (*NodeRPC) GetLightOPG

func (rpc *NodeRPC) GetLightOPG(ctx context.Context, block int64) (group []LightOperationGroup, err error)

GetLightOPG -

func (*NodeRPC) GetNetworkConstants

func (rpc *NodeRPC) GetNetworkConstants(ctx context.Context, level int64) (constants Constants, err error)

GetNetworkConstants -

func (*NodeRPC) GetOPG

func (rpc *NodeRPC) GetOPG(ctx context.Context, block int64) (group []OperationGroup, err error)

GetOPG -

func (*NodeRPC) GetRawScript

func (rpc *NodeRPC) GetRawScript(ctx context.Context, address string, level int64) ([]byte, error)

GetRawScript -

func (*NodeRPC) GetScriptJSON

func (rpc *NodeRPC) GetScriptJSON(ctx context.Context, address string, level int64) (script Script, err error)

GetScriptJSON -

func (*NodeRPC) GetScriptStorageRaw

func (rpc *NodeRPC) GetScriptStorageRaw(ctx context.Context, address string, level int64) ([]byte, error)

GetScriptStorageRaw -

func (*NodeRPC) RunCode

func (rpc *NodeRPC) RunCode(ctx context.Context, script, storage, input []byte, chainID, source, payer, entrypoint, proto string, amount, gas int64) (response RunCodeResponse, err error)

RunCode -

func (*NodeRPC) RunOperation

func (rpc *NodeRPC) RunOperation(ctx context.Context, chainID, branch, source, destination string, fee, gasLimit, storageLimit, counter, amount int64, parameters []byte) (group OperationGroup, err error)

RunOperation -

func (*NodeRPC) RunOperationLight

func (rpc *NodeRPC) RunOperationLight(ctx context.Context, chainID, branch, source, destination string, fee, gasLimit, storageLimit, counter, amount int64, parameters []byte) (group LightOperationGroup, err error)

RunOperationLight -

func (*NodeRPC) RunScriptView

func (rpc *NodeRPC) RunScriptView(ctx context.Context, request RunScriptViewRequest) ([]byte, error)

RunScriptView -

type NodeUnavailiableError

type NodeUnavailiableError struct {
	Node string
	Code int
}

NodeUnavailiableError -

func NewNodeUnavailiableError

func NewNodeUnavailiableError(node string, code int) NodeUnavailiableError

NewNodeUnavailiableError -

func (NodeUnavailiableError) Error

func (e NodeUnavailiableError) Error() string

Error -

type Operation

type Operation struct {
	Kind               string             `json:"kind"`
	Source             string             `json:"source"`
	Destination        *string            `json:"destination,omitempty"`
	Rollup             *string            `json:"rollup,omitempty"`
	Delegate           string             `json:"delegate,omitempty"`
	Fee                int64              `json:"fee,string"`
	Counter            int64              `json:"counter,string"`
	Balance            *int64             `json:"balance,omitempty,string"`
	GasLimit           int64              `json:"gas_limit,string"`
	StorageLimit       int64              `json:"storage_limit,string"`
	Amount             *int64             `json:"amount,omitempty,string"`
	Nonce              *int64             `json:"nonce,omitempty"`
	Tag                *string            `json:"tag,omitempty"`
	Entrypoint         *string            `json:"entrypoint,omitempty"`
	TicketTicketer     string             `json:"ticket_ticketer,omitempty"`
	TicketAmount       string             `json:"ticket_amount,omitempty"`
	PvmKind            string             `json:"pvm_kind,omitempty"`
	Kernel             string             `json:"kernel,omitempty"`
	CementedCommitment string             `json:"cemented_commitment,omitempty"`
	OutputProof        string             `json:"output_proof,omitempty"`
	Parameters         stdJSON.RawMessage `json:"parameters,omitempty"`
	Metadata           *OperationMetadata `json:"metadata,omitempty"`
	Result             *OperationResult   `json:"result,omitempty"`
	Script             stdJSON.RawMessage `json:"script,omitempty"`
	Value              stdJSON.RawMessage `json:"value,omitempty"`
	Payload            stdJSON.RawMessage `json:"payload,omitempty"`
	Type               stdJSON.RawMessage `json:"type,omitempty"`
	TicketContent      stdJSON.RawMessage `json:"ticket_contents,omitempty"`
	TicketType         stdJSON.RawMessage `json:"ticket_ty,omitempty"`
	ParameterType      stdJSON.RawMessage `json:"parameters_ty,omitempty"`
}

Operation -

func (Operation) GetResult

func (op Operation) GetResult() *OperationResult

GetResult -

type OperationError

type OperationError struct {
	ID              string             `json:"id"`
	Kind            string             `json:"kind"`
	Contract        string             `json:"contract,omitempty"`
	Location        *int64             `json:"location,omitempty"`
	ExpectedForm    stdJSON.RawMessage `json:"expectedForm,omitempty"`
	WrongExpression stdJSON.RawMessage `json:"wrongExpression,omitempty"`
}

OperationError -

type OperationGroup

type OperationGroup struct {
	Protocol  string      `json:"protocol"`
	ChainID   string      `json:"chain_id"`
	Hash      string      `json:"hash"`
	Branch    string      `json:"branch"`
	Signature string      `json:"signature"`
	Contents  []Operation `json:"contents"`
}

OperationGroup -

type OperationMetadata

type OperationMetadata struct {
	OperationResult    *OperationResult `json:"operation_result,omitempty"`
	Internal           []Operation      `json:"internal_operation_results,omitempty"`
	InternalOperations []Operation      `json:"internal_operations,omitempty"`
}

OperationMetadata -

type OperationResult

type OperationResult struct {
	Status                       string             `json:"status"`
	Storage                      stdJSON.RawMessage `json:"storage,omitempty"`
	ConsumedGas                  int64              `json:"consumed_gas,string"`
	ConsumedMilligas             *int64             `json:"consumed_milligas,omitempty,string"`
	StorageSize                  *int64             `json:"storage_size,omitempty,string"`
	Originated                   []string           `json:"originated_contracts,omitempty"`
	PaidStorageSizeDiff          *int64             `json:"paid_storage_size_diff,omitempty,string"`
	AllocatedDestinationContract *bool              `json:"allocated_destination_contract,omitempty"`
	BigMapDiffs                  []BigMapDiff       `json:"big_map_diff,omitempty"`
	Errors                       stdJSON.RawMessage `json:"errors,omitempty"`
	GlobalAddress                string             `json:"global_address,omitempty"`
	LazyStorageDiff              []LazyStorageDiff  `json:"lazy_storage_diff,omitempty"`
	OriginatedRollup             string             `json:"originated_rollup,omitempty"`
	TicketUpdates                []TicketUpdate     `json:"ticket_updates,omitempty"`
	TicketReceipt                []TicketUpdate     `json:"ticket_receipt,omitempty"`
	Address                      string             `json:"address,omitempty"`
	GenesisCommitmentHash        string             `json:"genesis_commitment_hash,omitempty"`
	Size                         string             `json:"size,omitempty"`
}

OperationResult -

type Pool

type Pool []*poolItem

Pool - node pool

func NewPool

func NewPool(urls []string, opts ...NodeOption) Pool

NewPool - creates `Pool` struct by `urls`

func NewWaitPool

func NewWaitPool(urls []string, opts ...NodeOption) Pool

NewWaitPool -

func (Pool) Block

func (p Pool) Block(ctx context.Context, level int64) (Block, error)

Block -

func (Pool) BlockHash

func (p Pool) BlockHash(ctx context.Context, level int64) (string, error)

BlockHash -

func (Pool) GetBigMapType

func (p Pool) GetBigMapType(ctx context.Context, ptr, level int64) (BigMap, error)

GetBigMapType -

func (Pool) GetBlockMetadata

func (p Pool) GetBlockMetadata(ctx context.Context, level int64) (Metadata, error)

GetBlockMetadata -

func (Pool) GetContractBalance

func (p Pool) GetContractBalance(ctx context.Context, address string, level int64) (int64, error)

GetContractBalance -

func (Pool) GetContractData

func (p Pool) GetContractData(ctx context.Context, address string, level int64) (ContractData, error)

GetContractData -

func (Pool) GetContractsByBlock

func (p Pool) GetContractsByBlock(ctx context.Context, block int64) ([]string, error)

GetContractsByBlock -

func (Pool) GetCounter

func (p Pool) GetCounter(ctx context.Context, address string) (int64, error)

GetCounter -

func (Pool) GetHead

func (p Pool) GetHead(ctx context.Context) (Header, error)

GetHead -

func (Pool) GetHeader

func (p Pool) GetHeader(ctx context.Context, block int64) (Header, error)

GetHeader -

func (Pool) GetLevel

func (p Pool) GetLevel(ctx context.Context) (int64, error)

GetLevel -

func (Pool) GetLightOPG

func (p Pool) GetLightOPG(ctx context.Context, block int64) ([]LightOperationGroup, error)

GetLightOPG -

func (Pool) GetNetworkConstants

func (p Pool) GetNetworkConstants(ctx context.Context, level int64) (res Constants, err error)

GetNetworkConstants -

func (Pool) GetOPG

func (p Pool) GetOPG(ctx context.Context, block int64) ([]OperationGroup, error)

GetOPG -

func (Pool) GetRawScript

func (p Pool) GetRawScript(ctx context.Context, address string, level int64) ([]byte, error)

GetRawScript -

func (Pool) GetScriptJSON

func (p Pool) GetScriptJSON(ctx context.Context, address string, level int64) (Script, error)

GetScriptJSON -

func (Pool) GetScriptStorageRaw

func (p Pool) GetScriptStorageRaw(ctx context.Context, address string, level int64) ([]byte, error)

GetScriptStorageRaw -

func (Pool) RunCode

func (p Pool) RunCode(ctx context.Context, script, storage, input []byte, chainID, source, payer, entrypoint, proto string, amount, gas int64) (RunCodeResponse, error)

RunCode -

func (Pool) RunOperation

func (p Pool) RunOperation(ctx context.Context, chainID, branch, source, destination string, fee, gasLimit, storageLimit, counter, amount int64, parameters []byte) (OperationGroup, error)

RunOperation -

func (Pool) RunOperationLight

func (p Pool) RunOperationLight(ctx context.Context, chainID, branch, source, destination string, fee, gasLimit, storageLimit, counter, amount int64, parameters []byte) (LightOperationGroup, error)

RunOperationLight -

func (Pool) RunScriptView

func (p Pool) RunScriptView(ctx context.Context, request RunScriptViewRequest) ([]byte, error)

RunScriptView -

type RunCodeError

type RunCodeError struct {
	ID   string             `json:"id"`
	Kind string             `json:"kind,omitempty"`
	With stdJSON.RawMessage `json:"with,omitempty"`
}

RunCodeError -

type RunCodeResponse

type RunCodeResponse struct {
	Operations       []Operation        `json:"operations"`
	Storage          stdJSON.RawMessage `json:"storage"`
	LazyStorageDiffs []LazyStorageDiff  `json:"lazy_storage_diff,omitempty"`
}

RunCodeResponse -

type RunScriptViewRequest

type RunScriptViewRequest struct {
	ChainID       string             `json:"chain_id"`
	Contract      string             `json:"contract"`
	View          string             `json:"view"`
	Input         stdJSON.RawMessage `json:"input"`
	Source        string             `json:"source,omitempty"`
	Payer         string             `json:"payer,omitempty"`
	Gas           int64              `json:"gas,string,omitempty"`
	UnparsingMode UnparsingMode      `json:"unparsing_mode"`
}

RunScriptViewRequest -

type RunScriptViewResponse

type RunScriptViewResponse struct {
	Data stdJSON.RawMessage `json:"data"`
}

RunScriptViewResponse -

type Script

type Script struct {
	Code    *ast.Script        `json:"code"`
	Storage stdJSON.RawMessage `json:"storage"`
}

Script -

func (*Script) GetSettledStorage

func (s *Script) GetSettledStorage() (*ast.TypedAst, error)

GetSettledStorage -

type TicketToken

type TicketToken struct {
	Ticketer    string             `json:"ticketer"`
	ContentType stdJSON.RawMessage `json:"content_type"`
	Content     stdJSON.RawMessage `json:"content"`
}

TicketToken -

type TicketUpdate

type TicketUpdate struct {
	TicketToken TicketToken        `json:"ticket_token"`
	Updates     []TicketUpdateItem `json:"updates"`
}

TicketUpdate -

type TicketUpdateItem

type TicketUpdateItem struct {
	Account string `json:"account"`
	Amount  string `json:"amount"`
}

TicketUpdateItem -

type UnparsingMode

type UnparsingMode string

UnparsingMode -

const (
	UnparsingModeReadable        UnparsingMode = "Readable"
	UnparsingModeOptimized       UnparsingMode = "Optimized"
	UnparsingModeOptimizedLegacy UnparsingMode = "Optimized_legacy"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL