business

package
v0.0.0-...-917f730 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMAND TezosClientArgumentKind = iota
	Mode
	BaseDirectory
	Protocol
	ProtocolConstants
	BootstrapAccounts
	BurnCap
	Fee
	Init
	Arg
	Entrypoint
	UnparsingMode
	// Parsing modes
	Readable  ParsingMode = "Readable"
	Optimized ParsingMode = "Optimized"
	// Michelson Formats
	Michelson MichelsonFormat = "michelson"
	JSON      MichelsonFormat = "json"
)

Variables

View Source
var (
	PLACEHOLDER__ADDRESS_OF_ACCOUNT = "TEST__ADDRESS_OF_ACCOUNT__"
	PLACEHOLDER__BALANCE_OF_ACCOUNT = "TEST__BALANCE_OF_ACCOUNT__"
)

Functions

func ExpandAccountPlaceholders

func ExpandAccountPlaceholders(addresses map[string]string, b []byte) []byte

ExpandAccountPlaceholders expands the real account address from a placeholder that identifies the account

func ExpandBalancePlaceholders

func ExpandBalancePlaceholders(mockup Mockup, b []byte) []byte

ExpandBalancePlaceholders expands the account balance from a placeholder that identifies the account

Types

type CallContractArgument

type CallContractArgument struct {
	Recipient  string
	Source     string
	Entrypoint string
	Amount     Mutez
	Parameter  string
}

type ContractCache

type ContractCache struct {
	StorageType ast.Node
}

type MichelsonFormat

type MichelsonFormat string

type Mockup

type Mockup struct {
	TaskID    string
	Protocol  string
	Config    config.Config
	Addresses map[string]string
	// contains filtered or unexported fields
}

func InitMockup

func InitMockup(taskID string, protocol string, cfg config.Config) Mockup

func (*Mockup) Bootstrap

func (m *Mockup) Bootstrap() error

Bootstrap bootstraps a mockup environment for the task

func (Mockup) CacheAccountAddress

func (m Mockup) CacheAccountAddress(name string, address string)

CacheAddress caches the address of a contract by name

func (Mockup) CacheContract

func (m Mockup) CacheContract(name string, code ast.Node) error

CacheContract caches contract information

func (Mockup) ContainsAddress

func (m Mockup) ContainsAddress(name string) bool

ContainsAddress checks if address exists

func (Mockup) GetBalance

func (m Mockup) GetBalance(name string) Mutez

GetBalance fetches the balance of a given address (implicit account or originated contract)

func (Mockup) GetCachedContract

func (m Mockup) GetCachedContract(name string) ContractCache

GetCachedContract get contract from cache

func (Mockup) GetContractStorage

func (m Mockup) GetContractStorage(contractName string) (ast.Node, error)

GetContractStorage fetches the storage of a given contract

func (Mockup) ImportSecret

func (m Mockup) ImportSecret(privateKey string, walletName string) error

func (Mockup) NormalizeData

func (m Mockup) NormalizeData(data string, dataType string, mode ParsingMode) (ast.Node, error)

NormalizeData normalize a data expression against a gicen type

func (*Mockup) Originate

func (m *Mockup) Originate(sender string, contractName string, amount Mutez, code string, storage string) (string, error)

Originate deploys a smart contract

func (Mockup) RevealWallet

func (m Mockup) RevealWallet(walletName string, revealFee Mutez) error

RevealWallet reveals wallet

func (*Mockup) SerializeData

func (m *Mockup) SerializeData(dataNode string, typeNode string) (string, error)

SerializeData serializes a michelson value

func (Mockup) Teardown

func (m Mockup) Teardown() error

Teardown clears task artifacts

func (Mockup) Transfer

func (m Mockup) Transfer(arg CallContractArgument) error

Transfer calls a given address

func (Mockup) UpdateChainID

func (m Mockup) UpdateChainID(chainID string) error

UpdateChainID updates the chain identifier in the mockup context

func (Mockup) UpdateHeadBlockLevel

func (m Mockup) UpdateHeadBlockLevel(level int32) error

UpdateHeadBlockLevel updates the level of the head block in the mockup context

func (Mockup) UpdateHeadBlockTimestamp

func (m Mockup) UpdateHeadBlockTimestamp(timestamp string) error

UpdateHeadBlockTimestamp updates the timestamp of the head block in the mockup context

type Mutez

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

func AddMutez

func AddMutez(m1 Mutez, m2 Mutez) Mutez

AddMutez adds two Mutez values and returns a the result

func MutezOfFloat

func MutezOfFloat(value *big.Float) Mutez

MutezOfFloat construct a Mutez value from big.Float

func MutezOfString

func MutezOfString(value string) (t Mutez, err error)

MutezOfString construct a Mutez value from a string

func (Mutez) String

func (m Mutez) String() string

String stringify a value of type Mutez

func (Mutez) ToTez

func (m Mutez) ToTez() Tez

ToTez convert mutez (uꜩ) to tez (ꜩ) 1 uꜩ => 0.000001 ꜩ

type ParsingMode

type ParsingMode string

type Tez

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

func TezOfFloat

func TezOfFloat(value *big.Float) Tez

TezOfFloat construct a Tez value from big.Float

func TezOfString

func TezOfString(value string) (t Tez, err error)

TezOfString construct a Tez value from a string

func (Tez) String

func (t Tez) String() string

String stringify a value of type Tez

func (Tez) ToMutez

func (t Tez) ToMutez() Mutez

ToMutez convert tez (ꜩ) to mutez (uꜩ) 1 ꜩ => 1000000 uꜩ

type TezosClientArgument

type TezosClientArgument struct {
	Kind       TezosClientArgumentKind
	Parameters []string
}

type TezosClientArgumentKind

type TezosClientArgumentKind int8

Directories

Path Synopsis
ast

Jump to

Keyboard shortcuts

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