setup

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FabTokenDriverName is name of the fabtoken driver
	FabTokenDriverName = driver.TokenDriverName("fabtoken")
	// ProtocolV1 is the v1 version
	ProtocolV1       = driver.TokenDriverVersion(1)
	DefaultPrecision = uint64(64)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicParams

type PublicParams struct {
	// DriverName is the name of the token driver this public params refer to.
	DriverName driver.TokenDriverName
	// DriverVersion is the version of the token driver this public params refer to.
	DriverVersion driver.TokenDriverVersion
	// The precision of token quantities
	QuantityPrecision uint64
	// MaxToken is the maximum quantity a token can hold
	MaxToken uint64
	// This is set when audit is enabled
	Auditor []byte
	// This encodes the list of authorized issuers
	IssuerIDs []driver.Identity
}

PublicParams is the public parameters for fabtoken

func NewPublicParamsFromBytes

func NewPublicParamsFromBytes(raw []byte, driverName driver.TokenDriverName) (*PublicParams, error)

NewPublicParamsFromBytes deserializes the raw bytes into public parameters The resulting public parameters are labeled with the passed label

func Setup

func Setup(precision uint64) (*PublicParams, error)

Setup initializes PublicParams

func (*PublicParams) AddAuditor

func (p *PublicParams) AddAuditor(auditor driver.Identity)

AddAuditor sets the Auditor field in PublicParams to the passed identity

func (*PublicParams) AddIssuer

func (p *PublicParams) AddIssuer(issuer driver.Identity)

AddIssuer adds the passed issuer to the array of Issuers in PublicParams

func (*PublicParams) AuditorIdentity

func (p *PublicParams) AuditorIdentity() driver.Identity

AuditorIdentity returns the auditor identity encoded in PublicParams

func (*PublicParams) Auditors

func (p *PublicParams) Auditors() []driver.Identity

Auditors returns the list of authorized auditors fabtoken only supports a single auditor

func (*PublicParams) Bytes

func (p *PublicParams) Bytes() ([]byte, error)

Bytes marshals PublicParams

func (*PublicParams) CertificationDriver

func (p *PublicParams) CertificationDriver() string

CertificationDriver returns the label of the PublicParams From the label, one can deduce what certification process will be used if any.

func (*PublicParams) Deserialize

func (p *PublicParams) Deserialize(raw []byte) error

Deserialize un-marshals the passed bytes into PublicParams

func (*PublicParams) FromBytes

func (p *PublicParams) FromBytes(data []byte) error

func (*PublicParams) GraphHiding

func (p *PublicParams) GraphHiding() bool

GraphHiding indicates if the PublicParams corresponds to a driver that hides the transaction graph fabtoken does not hide the graph, hence, GraphHiding returns false

func (*PublicParams) Issuers

func (p *PublicParams) Issuers() []driver.Identity

Issuers returns the list of authorized issuers

func (*PublicParams) MaxTokenValue

func (p *PublicParams) MaxTokenValue() uint64

MaxTokenValue returns the maximum value that a token can hold according to PublicParams

func (*PublicParams) Precision

func (p *PublicParams) Precision() uint64

Precision returns the quantity precision encoded in PublicParams

func (*PublicParams) Serialize

func (p *PublicParams) Serialize() ([]byte, error)

Serialize marshals a wrapper around PublicParams (SerializedPublicParams)

func (*PublicParams) SetAuditors

func (p *PublicParams) SetAuditors(ids []driver.Identity)

SetAuditors sets the auditors to the passed identities

func (*PublicParams) SetIssuers

func (p *PublicParams) SetIssuers(ids []driver.Identity)

SetIssuers sets the issuers to the passed identities

func (*PublicParams) String

func (p *PublicParams) String() string

func (*PublicParams) TokenDataHiding

func (p *PublicParams) TokenDataHiding() bool

TokenDataHiding indicates if the PublicParams corresponds to a driver that hides token data fabtoken does not hide token data, hence, TokenDataHiding returns false

func (*PublicParams) TokenDriverName

func (p *PublicParams) TokenDriverName() driver.TokenDriverName

TokenDriverName return the token driver name this public params refer to

func (*PublicParams) TokenDriverVersion

func (p *PublicParams) TokenDriverVersion() driver.TokenDriverVersion

func (*PublicParams) Validate

func (p *PublicParams) Validate() error

Validate validates the public parameters

Jump to

Keyboard shortcuts

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