dcdtconvert

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFullMockDCDTData

func GetFullMockDCDTData(source map[string][]byte, systemAccStorage map[string][]byte) (map[string]*MockDCDTData, error)

GetFullMockDCDTData returns the information about all the DCDT tokens held by the account.

func GetTokenBalance

func GetTokenBalance(tokenIdentifier []byte, nonce uint64, source map[string][]byte) (*big.Int, error)

GetTokenBalance returns the DCDT balance of the account, specified by the token key.

func GetTokenData

func GetTokenData(tokenIdentifier []byte, nonce uint64, source map[string][]byte, systemAccStorage map[string][]byte) (*dcdt.DCDigitalToken, error)

GetTokenData gets the DCDT information related to a token from the storage of the account.

func GetTokenRoles

func GetTokenRoles(tokenName []byte, source map[string][]byte) ([][]byte, error)

GetTokenRoles returns the roles of the account for the specified tokenName.

func MakeDCDTUserMetadataBytes

func MakeDCDTUserMetadataBytes(frozen bool) []byte

MakeDCDTUserMetadataBytes creates metadata byte slice

func SetLastNonce

func SetLastNonce(tokenIdentifier []byte, lastNonce uint64, destination map[string][]byte) error

SetLastNonce writes the last nonce of a specified DCDT into the storage.

func SetTokenBalance

func SetTokenBalance(tokenIdentifier []byte, nonce uint64, balance *big.Int, destination map[string][]byte) error

SetTokenBalance sets the DCDT balance of the account, specified by the token key.

func SetTokenData

func SetTokenData(tokenIdentifier []byte, nonce uint64, tokenData *dcdt.DCDigitalToken, destination map[string][]byte) error

SetTokenData sets the token data

func SetTokenRoles

func SetTokenRoles(tokenIdentifier []byte, roles [][]byte, destination map[string][]byte) error

SetTokenRoles sets the specified roles to the account, corresponding to the given tokenIdentifier.

func SetTokenRolesAsStrings

func SetTokenRolesAsStrings(tokenIdentifier []byte, rolesAsStrings []string, destination map[string][]byte) error

SetTokenRolesAsStrings sets the specified roles to the account, corresponding to the given tokenIdentifier.

func WriteScenariosDCDTToStorage

func WriteScenariosDCDTToStorage(dcdtData []*scenmodel.DCDTData, destination map[string][]byte) error

WriteScenariosDCDTToStorage writes the Scenarios DCDT data to the provided storage map

Types

type MockDCDTData

type MockDCDTData struct {
	TokenIdentifier []byte
	Instances       []*dcdt.DCDigitalToken
	LastNonce       uint64
	Roles           [][]byte
}

MockDCDTData groups together all instances of a token (same token name, different nonces).

Jump to

Keyboard shortcuts

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