asset

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	ID        string
	Age       int32
	Nonce     string
	Input     json.Object
	Hash      []byte
	PrevHash  []byte
	Signature []byte
	Key       ProofKey
}

Proof defines a proof stored in client-side to validate the server ledger states.

func FromGRPC

func FromGRPC(p *rpc.AssetProof) Proof

FromGRPC converts a rpc.AssetProof to a Proof.

func (Proof) Equal

func (p Proof) Equal(another Proof) bool

Equal checks if the asset proof has the same value with another one.

func (Proof) Serialize

func (p Proof) Serialize() (serialized []byte)

Serialize serialize the asset proof into a byte array.

func (Proof) String

func (p Proof) String() (s string)

String returns the text formatted as same as the Java package: com.google.common.base.MoreObjects.toStringHelper

func (Proof) ValueEqual

func (p Proof) ValueEqual(another Proof) bool

ValueEqual checks if the asset proof has the same values except the signature with another one.

func (Proof) VerifyWith

func (p Proof) VerifyWith(verifier crypto.Verifier) bool

VerifyWith checks if the signature of the asset proof can be verified by serialized value.

type ProofKey

type ProofKey struct {
	ID  string
	Age int32
}

ProofKey provides

func (ProofKey) Compare

func (k ProofKey) Compare(another ProofKey) int

Compare compares two asset keys.

func (ProofKey) Equal

func (k ProofKey) Equal(another ProofKey) bool

Equal tests if this key has the same values with another one.

Jump to

Keyboard shortcuts

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