Documentation
¶
Index ¶
- Variables
- func Authorized(ctx context.Context, db chain.Database, action chain.Action, ...) error
- func GetActor(auth chain.Auth) crypto.PublicKey
- func GetSigner(auth chain.Auth) crypto.PublicKey
- func UnmarshalDelegate(p *codec.Packer) (chain.Auth, error)
- func UnmarshalDirect(p *codec.Packer) (chain.Auth, error)
- type Delegate
- func (d *Delegate) AsyncVerify(msg []byte) error
- func (d *Delegate) CanDeduct(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Delegate) Deduct(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Delegate) Marshal(p *codec.Packer)
- func (*Delegate) MaxUnits(chain.Rules) uint64
- func (d *Delegate) Payer() []byte
- func (d *Delegate) Refund(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Delegate) StateKeys() [][]byte
- func (*Delegate) ValidRange(chain.Rules) (int64, int64)
- func (d *Delegate) Verify(ctx context.Context, r chain.Rules, db chain.Database, action chain.Action) (uint64, error)
- type DelegateFactory
- type Direct
- func (d *Direct) AsyncVerify(msg []byte) error
- func (d *Direct) CanDeduct(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Direct) Deduct(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Direct) Marshal(p *codec.Packer)
- func (*Direct) MaxUnits(chain.Rules) uint64
- func (d *Direct) Payer() []byte
- func (d *Direct) Refund(ctx context.Context, db chain.Database, amount uint64) error
- func (d *Direct) StateKeys() [][]byte
- func (*Direct) ValidRange(chain.Rules) (int64, int64)
- func (d *Direct) Verify(ctx context.Context, r chain.Rules, db chain.Database, action chain.Action) (uint64, error)
- type DirectFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSignature = errors.New("invalid signature") ErrActorMissing = errors.New("actor account is missing") ErrNotAllowed = errors.New("not allowed") ErrActionMissing = errors.New("action missing") ErrActorCantPay = errors.New("actor can't pay") ErrActorEqualsSigner = errors.New("actor equals signer, use direct") )
Functions ¶
func Authorized ¶
Types ¶
type Delegate ¶
type Delegate struct { Actor crypto.PublicKey `json:"actor"` Signer crypto.PublicKey `json:"signer"` Signature crypto.Signature `json:"signature"` ActorPays bool `json:"actorPays"` }
func (*Delegate) AsyncVerify ¶
type DelegateFactory ¶
type DelegateFactory struct {
// contains filtered or unexported fields
}
func NewDelegateFactory ¶
func NewDelegateFactory( actor crypto.PublicKey, priv crypto.PrivateKey, actorPays bool, ) *DelegateFactory
type Direct ¶
type Direct struct { Signer crypto.PublicKey `json:"signer"` Signature crypto.Signature `json:"signature"` }
func (*Direct) AsyncVerify ¶
type DirectFactory ¶
type DirectFactory struct {
// contains filtered or unexported fields
}
func NewDirectFactory ¶
func NewDirectFactory(priv crypto.PrivateKey) *DirectFactory
Click to show internal directories.
Click to hide internal directories.