state

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGenesisStateID added in v1.0.0

func CheckGenesisStateID(id, state *big.Int) (bool, error)

CheckGenesisStateID check if the state is genesis for the id.

Types

type ETHResolver

type ETHResolver struct {
	RPCUrl          string
	ContractAddress common.Address
}

ETHResolver resolver for eth blockchains

func NewETHResolver added in v1.0.0

func NewETHResolver(url, contract string) *ETHResolver

NewETHResolver create ETH resolver for state.

func (ETHResolver) Resolve

func (r ETHResolver) Resolve(ctx context.Context, id, state *big.Int) (*ResolvedState, error)

Resolve returns Resolved state from blockchain

func (ETHResolver) ResolveGlobalRoot added in v1.0.0

func (r ETHResolver) ResolveGlobalRoot(ctx context.Context, state *big.Int) (*ResolvedState, error)

ResolveGlobalRoot returns Resolved global state from blockchain

type ExtendedVerificationsOptions

type ExtendedVerificationsOptions struct {
	VerificationOptions
	OnlyLatestStates             bool
	AcceptedStateTransitionDelay time.Duration
}

ExtendedVerificationsOptions allows to set additional options

type GISTGetter added in v1.0.0

type GISTGetter interface {
	GetGISTRootInfo(opts *bind.CallOpts, root *big.Int) (abi.IStateGistRootInfo, error)
}

GISTGetter return global state info by state

type ResolvedState

type ResolvedState struct {
	State               string `json:"state"`
	Latest              bool   `json:"latest"`
	Genesis             bool   `json:"genesis"`
	TransitionTimestamp int64  `json:"transition_timestamp"`
}

ResolvedState can be the state verification result

func Resolve

func Resolve(ctx context.Context, getter StateGetter, id, state *big.Int) (*ResolvedState, error)

Resolve is used to resolve identity state.

func ResolveGlobalRoot added in v1.0.0

func ResolveGlobalRoot(ctx context.Context, getter GISTGetter, state *big.Int) (*ResolvedState, error)

ResolveGlobalRoot is used to resolve global root.

type StateGetter added in v1.0.0

type StateGetter interface {
	GetStateInfoByIdAndState(opts *bind.CallOpts, id, state *big.Int) (abi.IStateStateInfo, error)
}

StateGetter return user's state info by user's ID

type VerificationOptions

type VerificationOptions struct {
	Contract string
	RPCUrl   string
}

VerificationOptions is options for state verification

Directories

Path Synopsis
Package mock_state is a generated GoMock package.
Package mock_state is a generated GoMock package.

Jump to

Keyboard shortcuts

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