counterfactualsrv

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CompressedPkLen = 33

Variables

This section is empty.

Functions

This section is empty.

Types

type Counterfactual

type Counterfactual struct {
	Operational   common.Address   `json:"operational"`
	OperationalPk *utils.PublicKey `json:"operationalPk"`
	Relayer       common.Address   `json:"relayer"`
	Recoverer     common.Address   `json:"recoverer"`
	Revokator     common.Address   `json:"revokator"`
	Impl          common.Address   `json:"impl"`
}

func (*Counterfactual) Decode

func (i *Counterfactual) Decode(encoded []byte) error

func (*Counterfactual) Encode

func (i *Counterfactual) Encode() []byte

type Info

type Info struct {
	Codehash      common.Hash
	Impl          common.Address
	Recoverer     common.Address
	RecovererProp common.Address
	Revoker       common.Address
	Relay         common.Address
	LastNonce     *big.Int
}

type Service

type Service interface {
	Initialized() bool
	AddressOf(counterfactual *Counterfactual) (common.Address, error)
	Deploy(counterfactual *Counterfactual) (common.Address, *types.Transaction, error)
	IsDeployed(ethAddr common.Address) (bool, error)
	Info(ethAddr common.Address) (*Info, error)
	Forward(id core.ID, ethAddr common.Address, ksignpk *ecdsa.PublicKey, to common.Address, data []byte, value *big.Int, gas uint64, sig []byte) (common.Hash, error)
	Add(id core.ID, counterfactual *Counterfactual) (*core.ProofClaim, error)
	List(limit int) ([]common.Address, error)
	Get(ethAddr common.Address) (*Counterfactual, error)
	DeployerAddr() *common.Address
	ImplAddr() *common.Address
}

type ServiceImpl

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

func New

func New(deployer, impl, proxy *eth.Contract, cs claimsrv.Service, sto db.Storage) *ServiceImpl

func (*ServiceImpl) Add

func (is *ServiceImpl) Add(id core.ID, counterfactual *Counterfactual) (*core.ProofClaim, error)

Add creates a merkle tree of a new user in the relay, given the identity data of the user.

func (*ServiceImpl) AddressOf

func (is *ServiceImpl) AddressOf(counterfactual *Counterfactual) (common.Address, error)

AddressOf returns the address of the smart contract given the identity data of a user.

func (*ServiceImpl) Deploy

func (is *ServiceImpl) Deploy(counterfactual *Counterfactual) (common.Address, *types.Transaction, error)

Deploy deploys the user's smart contract in the blockchain.

func (*ServiceImpl) DeployerAddr

func (is *ServiceImpl) DeployerAddr() *common.Address

func (*ServiceImpl) Forward

func (is *ServiceImpl) Forward(
	id core.ID,
	ethAddr common.Address,
	ksignpk *ecdsa.PublicKey,
	to common.Address,
	data []byte,
	value *big.Int,
	gas uint64,
	sig []byte,
) (common.Hash, error)

func (*ServiceImpl) Get

func (is *ServiceImpl) Get(ethAddr common.Address) (*Counterfactual, error)

func (*ServiceImpl) ImplAddr

func (is *ServiceImpl) ImplAddr() *common.Address

func (*ServiceImpl) Info

func (is *ServiceImpl) Info(ethAddr common.Address) (*Info, error)

func (*ServiceImpl) Initialized

func (is *ServiceImpl) Initialized() bool

func (*ServiceImpl) IsDeployed

func (is *ServiceImpl) IsDeployed(ethAddr common.Address) (bool, error)

IsDeployed checks if the users's smart contract is deployed in the blockchain.

func (*ServiceImpl) List

func (is *ServiceImpl) List(limit int) ([]common.Address, error)

Jump to

Keyboard shortcuts

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