Documentation
¶
Overview ¶
Overflow is a DSL to help interact with the flow blockchain using go
By bjartek aka Bjarte Karlsen
Example ¶
//in order to start overflow use the Overflow function //it can be customized with lots of OverflowOption Overflow()
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00
Index ¶
- func CadenceValueToInterface(field cadence.Value) interface{}
- func CadenceValueToJsonString(value cadence.Value) (string, error)
- func PrintEvents(events []flow.Event, ignoreFields map[string][]string)deprecated
- type OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Account(key string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) AccountArray(value ...string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Address(key string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Argument(value cadence.Value) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Boolean(value bool) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Build() []cadence.Valuedeprecated
- func (a *OverflowArgumentsBuilder) Bytes(value []byte) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) DateStringAsUnixTimestamp(dateString string, timezone string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Fix64(value string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int(value int) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int128(value int) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int16(value int16) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int256(value int) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int32(value int32) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int64(value int64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Int8(value int8) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) PrivatePath(input string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) PublicPath(input string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) RawAccount(address string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) RawAddress(address string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) RawAddressArray(value ...string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) ScalarMap(input map[string]string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) ScalarMapArray(value ...map[string]string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) StoragePath(input string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) String(value string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) StringArray(value ...string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) StringMap(input map[string]string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) StringMapArray(value ...map[string]string) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UFix64(input float64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UFix64Array(value ...float64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt(value uint) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt128(value uint) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt16(value uint16) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt256(value uint) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt32(value uint32) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt64(value uint64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt64Array(value ...uint64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt8(value uint8) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) UInt8Array(value ...uint8) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Word16(value uint16) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Word32(value uint32) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Word64(value uint64) *OverflowArgumentsBuilderdeprecated
- func (a *OverflowArgumentsBuilder) Word8(value uint8) *OverflowArgumentsBuilderdeprecated
- type OverflowBuilder
- func NewOverflow() *OverflowBuilderdeprecated
- func NewOverflowBuilder(network string, newEmulator bool, logLevel int) *OverflowBuilderdeprecated
- func NewOverflowEmulator() *OverflowBuilderdeprecated
- func NewOverflowForNetwork(network string) *OverflowBuilderdeprecated
- func NewOverflowInMemoryEmulator() *OverflowBuilder
- func NewOverflowMainnet() *OverflowBuilderdeprecated
- func NewOverflowTestnet() *OverflowBuilderdeprecated
- func NewTestingEmulator() *OverflowBuilderdeprecated
- func (o *OverflowBuilder) BasePath(path string) *OverflowBuilderdeprecated
- func (o *OverflowBuilder) Config(files ...string) *OverflowBuilderdeprecated
- func (o *OverflowBuilder) DefaultGas(gas int) *OverflowBuilderdeprecated
- func (o *OverflowBuilder) DoNotPrependNetworkToAccountNames() *OverflowBuilderdeprecated
- func (o *OverflowBuilder) ExistingEmulator() *OverflowBuilderdeprecated
- func (o *OverflowBuilder) NoneLog() *OverflowBuilderdeprecated
- func (o *OverflowBuilder) SetServiceSuffix(suffix string) *OverflowBuilderdeprecated
- func (ob *OverflowBuilder) Start() *OverflowStatedeprecated
- func (o *OverflowBuilder) StartE() (*OverflowState, error)
- type OverflowCodeWithSpec
- type OverflowDeclarationInfo
- type OverflowEmulatorLogMessage
- type OverflowEvent
- type OverflowEventFetcherBuilder
- func (e OverflowEventFetcherBuilder) BatchSize(batchSize uint64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) End(blockHeight uint64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) Event(eventName string) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) EventIgnoringFields(eventName string, ignoreFields []string) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) From(blockHeight int64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) Last(number uint64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) Run() ([]*OverflowFormatedEvent, error)deprecated
- func (e OverflowEventFetcherBuilder) Start(blockHeight int64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) TrackProgressIn(fileName string) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) Until(blockHeight uint64) OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) UntilCurrent() OverflowEventFetcherBuilderdeprecated
- func (e OverflowEventFetcherBuilder) Workers(workers int) OverflowEventFetcherBuilderdeprecated
- type OverflowEventFetcherOption
- func WithBatchSize(size uint64) OverflowEventFetcherOption
- func WithEndIndex(blockHeight uint64) OverflowEventFetcherOption
- func WithEvent(eventName string) OverflowEventFetcherOption
- func WithEventIgnoringField(eventName string, ignoreFields []string) OverflowEventFetcherOption
- func WithFromIndex(blockHeight int64) OverflowEventFetcherOption
- func WithLastBlocks(number uint64) OverflowEventFetcherOption
- func WithStartHeight(blockHeight int64) OverflowEventFetcherOption
- func WithTrackProgressIn(fileName string) OverflowEventFetcherOption
- func WithUntilBlock(blockHeight uint64) OverflowEventFetcherOption
- func WithUntilCurrentBlock() OverflowEventFetcherOption
- func WithWorkers(workers int) OverflowEventFetcherOption
- type OverflowEventFilter
- type OverflowEvents
- func (overflowEvents OverflowEvents) FilterEvents(ignoreFields OverflowEventFilter) OverflowEvents
- func (overflowEvents OverflowEvents) FilterFees(fee float64) OverflowEvents
- func (overflowEvents OverflowEvents) FilterTempWithdrawDeposit() OverflowEvents
- func (overflowEvents OverflowEvents) Print(t *testing.T)
- type OverflowFormatedEventdeprecated
- func FormatEvents(blockEvents []flow.BlockEvents, ignoreFields map[string][]string) []*OverflowFormatedEvent
- func NewTestEvent(name string, fields map[string]interface{}) *OverflowFormatedEventdeprecated
- func ParseEvent(event flow.Event, blockHeight uint64, time time.Time, ignoreFields []string) *OverflowFormatedEvent
- type OverflowInteractionBuilder
- func (t OverflowInteractionBuilder) Args(args *OverflowArgumentsBuilder) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) ArgsFn(fn func(*OverflowArgumentsBuilder)) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) ArgsV(args []cadence.Value) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) Gas(limit uint64) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) NamedArguments(args map[string]string) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) PayloadSigner(value string) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) Run() []flow.Eventdeprecated
- func (t OverflowInteractionBuilder) RunE() ([]flow.Event, error)deprecated
- func (t OverflowInteractionBuilder) RunGetEventsWithName(eventName string) []OverflowFormatedEventdeprecated
- func (t OverflowInteractionBuilder) RunGetEventsWithNameOrError(eventName string) ([]OverflowFormatedEvent, error)deprecated
- func (t OverflowInteractionBuilder) RunGetIdFromEvent(eventName string, fieldName string) uint64
- func (t OverflowInteractionBuilder) RunGetIdFromEventPrintAll(eventName string, fieldName string) uint64deprecated
- func (t OverflowInteractionBuilder) RunGetIds(eventName string, fieldName string) ([]uint64, error)deprecated
- func (t OverflowInteractionBuilder) RunPrintEvents(ignoreFields map[string][]string)deprecated
- func (t OverflowInteractionBuilder) RunPrintEventsFull()deprecated
- func (oib OverflowInteractionBuilder) Send() *OverflowResult
- func (t OverflowInteractionBuilder) SignProposeAndPayAs(signer string) OverflowInteractionBuilderdeprecated
- func (t OverflowInteractionBuilder) SignProposeAndPayAsService() OverflowInteractionBuilderdeprecated
- func (f OverflowInteractionBuilder) Test(t *testing.T) OverflowTransactionResultdeprecated
- func (t OverflowInteractionBuilder) TransactionPath(path string) OverflowInteractionBuilderdeprecated
- type OverflowInteractionOption
- func WithAddresses(name string, value ...string) OverflowInteractionOption
- func WithArg(name string, value interface{}) OverflowInteractionOption
- func WithArgDateTime(name string, dateString string, timezone string) OverflowInteractionOption
- func WithArgs(args ...interface{}) OverflowInteractionOption
- func WithArgsMap(args map[string]interface{}) OverflowInteractionOption
- func WithEventsFilter(filter OverflowEventFilter) OverflowInteractionOption
- func WithMaxGas(gas uint64) OverflowInteractionOption
- func WithName(name string) OverflowInteractionOption
- func WithPayloadSigner(signer ...string) OverflowInteractionOption
- func WithPrintOptions(opts ...OverflowPrinterOption) OverflowInteractionOption
- func WithProposer(proposer string) OverflowInteractionOption
- func WithProposerServiceAccount() OverflowInteractionOption
- func WithSigner(signer string) OverflowInteractionOption
- func WithSignerServiceAccount() OverflowInteractionOption
- func WithoutGlobalEventFilter() OverflowInteractionOption
- func WithoutLog() OverflowInteractionOption
- type OverflowMeter
- type OverflowMeteredComputationIntensities
- type OverflowMeteredMemoryIntensities
- type OverflowOption
- func WithBasePath(path string) OverflowOption
- func WithEmptyDepositWithdrawEvents() OverflowOption
- func WithExistingEmulator() OverflowOption
- func WithFeesEvents() OverflowOption
- func WithFlowConfig(files ...string) OverflowOption
- func WithFlowForNewUsers(amount float64) OverflowOption
- func WithGas(gas int) OverflowOption
- func WithGlobalEventFilter(filter OverflowEventFilter) OverflowOption
- func WithGlobalPrintOptions(opts ...OverflowPrinterOption) OverflowOption
- func WithLogFull() OverflowOption
- func WithLogInfo() OverflowOption
- func WithLogNone() OverflowOption
- func WithNetwork(network string) OverflowOption
- func WithNoPrefixToAccountNames() OverflowOption
- func WithPanicOnError() OverflowOption
- func WithScriptFolderName(name string) OverflowOption
- func WithServiceAccountSuffix(suffix string) OverflowOption
- func WithTransactionFolderName(name string) OverflowOption
- func WithoutTransactionFees() OverflowOption
- type OverflowPastEvent
- type OverflowPrinterBuilder
- type OverflowPrinterOption
- func WithEmulatorLog() OverflowPrinterOption
- func WithEventFilter(filter OverflowEventFilter) OverflowPrinterOption
- func WithFullMeter() OverflowPrinterOption
- func WithMeter() OverflowPrinterOption
- func WithoutEvents() OverflowPrinterOption
- func WithoutId() OverflowPrinterOption
- func WithoutMeter(value int) OverflowPrinterOption
- type OverflowResult
- func (o OverflowResult) AssertComputationLessThenOrEqual(t *testing.T, computation int) OverflowResult
- func (o OverflowResult) AssertComputationUsed(t *testing.T, computation int) OverflowResult
- func (o OverflowResult) AssertDebugLog(t *testing.T, message ...string) OverflowResult
- func (o OverflowResult) AssertEmitEventName(t *testing.T, event ...string) OverflowResult
- func (o OverflowResult) AssertEmulatorLog(t *testing.T, message string) OverflowResult
- func (o OverflowResult) AssertEvent(t *testing.T, name string, fields OverflowEvent) OverflowResult
- func (o OverflowResult) AssertEventCount(t *testing.T, number int) OverflowResult
- func (o OverflowResult) AssertFailure(t *testing.T, msg string) OverflowResult
- func (o OverflowResult) AssertNoEvents(t *testing.T) OverflowResult
- func (o OverflowResult) AssertSuccess(t *testing.T) OverflowResult
- func (o OverflowResult) GetEventsWithName(eventName string) []OverflowEvent
- func (o OverflowResult) GetIdFromEvent(eventName string, fieldName string) (uint64, error)
- func (o OverflowResult) GetIdsFromEvent(eventName string, fieldName string) []uint64
- func (o OverflowResult) Print(opbs ...OverflowPrinterOption) OverflowResult
- type OverflowScriptBuilderdeprecated
- func (t OverflowScriptBuilder) Args(args *OverflowArgumentsBuilder) OverflowScriptBuilderdeprecated
- func (t OverflowScriptBuilder) ArgsFn(fn func(*OverflowArgumentsBuilder)) OverflowScriptBuilderdeprecated
- func (t OverflowScriptBuilder) ArgsV(args []cadence.Value) OverflowScriptBuilderdeprecated
- func (t OverflowScriptBuilder) NamedArguments(args map[string]string) OverflowScriptBuilderdeprecated
- func (t OverflowScriptBuilder) Run()
- func (t OverflowScriptBuilder) RunFailOnError() cadence.Valuedeprecated
- func (t OverflowScriptBuilder) RunMarshalAs(value interface{}) errordeprecated
- func (t OverflowScriptBuilder) RunReturns() (cadence.Value, error)deprecated
- func (t OverflowScriptBuilder) RunReturnsInterface() interface{}deprecated
- func (t OverflowScriptBuilder) RunReturnsJsonString() stringdeprecated
- func (t OverflowScriptBuilder) ScriptPath(path string) OverflowScriptBuilderdeprecated
- type OverflowScriptFunction
- type OverflowScriptOptsFunction
- type OverflowScriptResult
- func (osr *OverflowScriptResult) AssertLengthWithPointer(t *testing.T, pointer string, length int) *OverflowScriptResult
- func (osr *OverflowScriptResult) AssertWant(t *testing.T, want autogold.Value) *OverflowScriptResult
- func (osr *OverflowScriptResult) AssertWithPointer(t *testing.T, pointer string, value interface{}) *OverflowScriptResult
- func (osr *OverflowScriptResult) AssertWithPointerError(t *testing.T, pointer string, message string) *OverflowScriptResult
- func (osr *OverflowScriptResult) AssertWithPointerWant(t *testing.T, pointer string, want autogold.Value) *OverflowScriptResult
- func (osr *OverflowScriptResult) GetAsInterface() (interface{}, error)
- func (osr *OverflowScriptResult) GetAsJson() (string, error)
- func (osr *OverflowScriptResult) GetWithPointer(pointer string) (interface{}, error)
- func (osr *OverflowScriptResult) MarshalAs(marshalTo interface{}) error
- func (osr *OverflowScriptResult) MarshalPointerAs(pointer string, marshalTo interface{}) error
- func (osr *OverflowScriptResult) Print() *OverflowScriptResult
- type OverflowSolution
- type OverflowSolutionMerged
- type OverflowSolutionMergedNetwork
- type OverflowSolutionNetwork
- type OverflowState
- func (o *OverflowState) Account(key string) *flowkit.Account
- func (o *OverflowState) AccountE(key string) (*flowkit.Account, error)
- func (o *OverflowState) Address(key string) string
- func (o *OverflowState) Arguments() *OverflowArgumentsBuilderdeprecated
- func (o *OverflowState) BuildInteraction(filename string, interactionType string, opts ...OverflowInteractionOption) *OverflowInteractionBuilder
- func (o *OverflowState) CreateAccountsE() (*OverflowState, error)
- func (o *OverflowState) DownloadAndUploadFile(url string, accountName string) error
- func (o *OverflowState) DownloadImageAndUploadAsDataUrl(url, accountName string) error
- func (o *OverflowState) EventFetcher() OverflowEventFetcherBuilderdeprecated
- func (o *OverflowState) FetchEvents(opts ...OverflowEventFetcherOption) ([]OverflowPastEvent, error)
- func (o *OverflowState) FillUpStorage(accountName string) *OverflowState
- func (o *OverflowState) GetAccount(key string) (*flow.Account, error)
- func (o *OverflowState) GetBlockAtHeight(height uint64) (*flow.Block, error)
- func (o *OverflowState) GetBlockById(blockId string) (*flow.Block, error)
- func (o *OverflowState) GetFreeCapacity(accountName string) int
- func (o *OverflowState) GetLatestBlock() (*flow.Block, error)
- func (o *OverflowState) InitializeContracts() *OverflowState
- func (o *OverflowState) InlineScript(content string) OverflowScriptBuilderdeprecated
- func (o *OverflowState) MintFlowTokens(accountName string, amount float64) *OverflowState
- func (o *OverflowState) Parse(codeFileName string, code []byte, network string) (string, error)
- func (o *OverflowState) ParseAll() (*OverflowSolution, error)
- func (o *OverflowState) ParseAllWithConfig(skipContracts bool, txSkip []string, scriptSkip []string) (*OverflowSolution, error)
- func (o *OverflowState) ParseArgumentsWithoutType(fileName string, code []byte, inputArgs map[string]string) ([]cadence.Value, error)deprecated
- func (o *OverflowState) Script(filename string, opts ...OverflowInteractionOption) *OverflowScriptResult
- func (o *OverflowState) ScriptFN(outerOpts ...OverflowInteractionOption) OverflowScriptFunction
- func (o *OverflowState) ScriptFileNameFN(filename string, outerOpts ...OverflowInteractionOption) OverflowScriptOptsFunction
- func (o *OverflowState) ScriptFromFile(filename string) OverflowScriptBuilderdeprecated
- func (o *OverflowState) ServiceAccountName() string
- func (o *OverflowState) SignUserMessage(account string, message string) (string, error)
- func (o *OverflowState) SimpleTxArgs(filename string, signer string, args *OverflowArgumentsBuilder)deprecated
- func (o *OverflowState) Transaction(content string) OverflowInteractionBuilderdeprecated
- func (o *OverflowState) TransactionFromFile(filename string) OverflowInteractionBuilderdeprecated
- func (o *OverflowState) Tx(filename string, opts ...OverflowInteractionOption) *OverflowResult
- func (o *OverflowState) TxFN(outerOpts ...OverflowInteractionOption) OverflowTransactionFunction
- func (o *OverflowState) TxFileNameFN(filename string, outerOpts ...OverflowInteractionOption) OverflowTransactionOptsFunction
- func (o *OverflowState) UploadFile(filename string, accountName string) error
- func (o *OverflowState) UploadImageAsDataUrl(filename string, accountName string) error
- func (o *OverflowState) UploadString(content string, accountName string) error
- type OverflowTransactionFunction
- type OverflowTransactionOptsFunction
- type OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertComputationLessThenOrEqual(computation int) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertComputationUsed(computation int) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertDebugLog(message ...string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEmitEvent(event ...*OverflowFormatedEvent) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEmitEventJson(event ...string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEmitEventName(event ...string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEmitEventNameShortForm(event ...string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEmulatorLog(message string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertEventCount(number int) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertFailure(msg string) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertNoEvents() OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertPartialEvent(expected *OverflowFormatedEvent) OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) AssertSuccess() OverflowTransactionResultdeprecated
- func (t OverflowTransactionResult) GetIdFromEvent(eventName string, fieldName string) uint64deprecated
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CadenceValueToInterface ¶
CadenceValueToInterface convert a candence.Value into interface{}
func CadenceValueToJsonString ¶
CadenceValueToJsonString converts a cadence.Value into a json pretty printed string
func PrintEvents
deprecated
added in
v1.0.0
Types ¶
type OverflowArgumentsBuilder
deprecated
added in
v1.0.0
type OverflowArgumentsBuilder struct { Overflow *OverflowState Arguments []cadence.Value Error error }
OverflowArgumentsBuilder
The old way of specifying arguments to interactions ¶
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Account
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Account(key string) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) AccountArray
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) AccountArray(value ...string) *OverflowArgumentsBuilder
Argument add a RawAddressArray to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Address
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Address(key string) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Argument
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Argument(value cadence.Value) *OverflowArgumentsBuilder
Argument add an argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Boolean
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Boolean(value bool) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Build
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Build() []cadence.Value
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Bytes
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Bytes(value []byte) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) DateStringAsUnixTimestamp
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) DateStringAsUnixTimestamp(dateString string, timezone string) *OverflowArgumentsBuilder
DateStringAsUnixTimestamp sends a dateString parsed in the timezone as a unix timeszone ufix
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Fix64
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Fix64(value string) *OverflowArgumentsBuilder
Fix64 add a Fix64 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int(value int) *OverflowArgumentsBuilder
Int add an Int Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int128
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int128(value int) *OverflowArgumentsBuilder
Int128 add an Int128 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int16
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int16(value int16) *OverflowArgumentsBuilder
Int16 add an Int16 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int256
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int256(value int) *OverflowArgumentsBuilder
Int256 add an Int256 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int32
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int32(value int32) *OverflowArgumentsBuilder
Int32 add an Int32 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int64
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int64(value int64) *OverflowArgumentsBuilder
Int64 add an Int64 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Int8
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Int8(value int8) *OverflowArgumentsBuilder
Int8 add an Int8 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) PrivatePath
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) PrivatePath(input string) *OverflowArgumentsBuilder
PrivatePath argument
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) PublicPath
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) PublicPath(input string) *OverflowArgumentsBuilder
PublicPath argument
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) RawAccount
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) RawAccount(address string) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) RawAddress
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) RawAddress(address string) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) RawAddressArray
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) RawAddressArray(value ...string) *OverflowArgumentsBuilder
Argument add a RawAddressArray to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) ScalarMap
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) ScalarMap(input map[string]string) *OverflowArgumentsBuilder
Add an {String:UFix64} to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) ScalarMapArray
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) ScalarMapArray(value ...map[string]string) *OverflowArgumentsBuilder
Argument add an StringArray to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) StoragePath
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) StoragePath(input string) *OverflowArgumentsBuilder
StoragePath argument
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) String
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) String(value string) *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) StringArray
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) StringArray(value ...string) *OverflowArgumentsBuilder
Argument add an StringArray to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) StringMap
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) StringMap(input map[string]string) *OverflowArgumentsBuilder
Add an {String:String} to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) StringMapArray
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) StringMapArray(value ...map[string]string) *OverflowArgumentsBuilder
Argument add an StringMapArray to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UFix64
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UFix64(input float64) *OverflowArgumentsBuilder
UFix64 add a UFix64 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UFix64Array
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UFix64Array(value ...float64) *OverflowArgumentsBuilder
Argument add an argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt(value uint) *OverflowArgumentsBuilder
UInt add an UInt Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt128
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt128(value uint) *OverflowArgumentsBuilder
UInt128 add an UInt128 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt16
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt16(value uint16) *OverflowArgumentsBuilder
UInt16 add an UInt16 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt256
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt256(value uint) *OverflowArgumentsBuilder
UInt256 add an UInt256 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt32
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt32(value uint32) *OverflowArgumentsBuilder
UInt32 add an UInt32 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt64
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt64(value uint64) *OverflowArgumentsBuilder
UInt64 add an UInt64 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt64Array
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt64Array(value ...uint64) *OverflowArgumentsBuilder
Argument add an argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt8
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt8(value uint8) *OverflowArgumentsBuilder
UInt8 add an UInt8 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) UInt8Array
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) UInt8Array(value ...uint8) *OverflowArgumentsBuilder
Argument add an argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Word16
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Word16(value uint16) *OverflowArgumentsBuilder
Word16 add a Word16 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Word32
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Word32(value uint32) *OverflowArgumentsBuilder
Word32 add a Word32 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Word64
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Word64(value uint64) *OverflowArgumentsBuilder
Word64 add a Word64 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowArgumentsBuilder) Word8
deprecated
added in
v1.0.0
func (a *OverflowArgumentsBuilder) Word8(value uint8) *OverflowArgumentsBuilder
Word8 add a Word8 Argument to the transaction
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
type OverflowBuilder ¶
type OverflowBuilder struct { TransactionFees bool Network string InMemory bool DeployContracts bool GasLimit int Path string LogLevel int InitializeAccounts bool PrependNetworkName bool ServiceSuffix string ConfigFiles []string TransactionFolderName string ScriptFolderName string FilterOutFeeEvents bool FilterOutEmptyWithDrawDepositEvents bool GlobalEventFilter OverflowEventFilter StopOnError bool PrintOptions *[]OverflowPrinterOption NewAccountFlowAmount float64 }
OverflowBuilder is the struct used to gather up configuration when building an overflow instance
func NewOverflow
deprecated
added in
v1.0.0
func NewOverflow() *OverflowBuilder
NewOverflow creates a new OverflowBuilder reading some confiuration from ENV var ( OVERFLOW_ENV : sets the environment to use, valid values here are emulator|testnet|mainnet|embedded OVERFLOW_CONTINUE : if set to `true` will not create accounts and deploy contracts even if on embedded/emulator OVERFLOW_LOGGING : set the logging level of flowkit and overflow itself, 0 = No Log, 1 = Errors only, 2 = Debug, 3(default) = Info
Deprecated: use Overflow function with builder
func NewOverflowBuilder
deprecated
added in
v1.0.0
func NewOverflowBuilder(network string, newEmulator bool, logLevel int) *OverflowBuilder
Deprecated: use Overflow function with builder
func NewOverflowEmulator
deprecated
added in
v1.0.0
func NewOverflowEmulator() *OverflowBuilder
NewOverflowEmulator create a new client
Deprecated: use Overflow function with builder
func NewOverflowForNetwork
deprecated
added in
v1.0.0
func NewOverflowForNetwork(network string) *OverflowBuilder
NewOverflowForNetwork creates a new overflow client for the provided network
Deprecated: use Overflow function with builder
func NewOverflowInMemoryEmulator ¶ added in v1.0.0
func NewOverflowInMemoryEmulator() *OverflowBuilder
NewOverflowInMemoryEmulator this method is used to create an in memory emulator, deploy all contracts for the emulator and create all accounts Deprecated: use Overflow function with builder
func NewOverflowMainnet
deprecated
added in
v1.0.0
func NewOverflowMainnet() *OverflowBuilder
NewOverflowMainnet creates a new gwft client for mainnet
Deprecated: use Overflow function with builder
func NewOverflowTestnet
deprecated
added in
v1.0.0
func NewOverflowTestnet() *OverflowBuilder
NewOverflowTestnet creates a new overflow client for devnet/testnet
Deprecated: use Overflow function with builder
func NewTestingEmulator
deprecated
added in
v1.0.0
func NewTestingEmulator() *OverflowBuilder
NewTestingEmulator starts an embedded emulator with no log to be used most often in tests
Deprecated: use Overflow function with builder
func (*OverflowBuilder) BasePath
deprecated
added in
v1.0.0
func (o *OverflowBuilder) BasePath(path string) *OverflowBuilder
BasePath set the base path for transactions/scripts/contracts
Deprecated: use Overflow function with builder
func (*OverflowBuilder) Config
deprecated
added in
v1.0.0
func (o *OverflowBuilder) Config(files ...string) *OverflowBuilder
Config sets the file path to the flow.json config files to use
Deprecated: use Overflow function with builder
func (*OverflowBuilder) DefaultGas
deprecated
added in
v1.0.0
func (o *OverflowBuilder) DefaultGas(gas int) *OverflowBuilder
DefaultGas sets the default gas limit to use
Deprecated: use Overflow function with builder
func (*OverflowBuilder) DoNotPrependNetworkToAccountNames
deprecated
added in
v1.0.0
func (o *OverflowBuilder) DoNotPrependNetworkToAccountNames() *OverflowBuilder
DoNotPrependNetworkToAccountNames sets that network names will not be prepends to account names
Deprecated: use Overflow function with builder
func (*OverflowBuilder) ExistingEmulator
deprecated
added in
v1.0.0
func (o *OverflowBuilder) ExistingEmulator() *OverflowBuilder
ExistingEmulator this if you are using an existing emulator and you do not want to create contracts or initializeAccounts
Deprecated: use Overflow function with builder
func (*OverflowBuilder) NoneLog
deprecated
added in
v1.0.0
func (o *OverflowBuilder) NoneLog() *OverflowBuilder
NoneLog will turn of logging, making the script work well in batch jobs
Deprecated: use Overflow function with builder
func (*OverflowBuilder) SetServiceSuffix
deprecated
added in
v1.0.0
func (o *OverflowBuilder) SetServiceSuffix(suffix string) *OverflowBuilder
SetServiceSuffix will set the suffix to use for the service account. The default is `account`
Deprecated: use Overflow function with builder
func (*OverflowBuilder) Start
deprecated
added in
v1.0.0
func (ob *OverflowBuilder) Start() *OverflowState
Start will start the overflow builder and return OverflowState, will panic if there are errors
Deprecated: use Overflow function with builder
func (*OverflowBuilder) StartE ¶
func (o *OverflowBuilder) StartE() (*OverflowState, error)
StartE will start Overflow and return State and error if any
type OverflowCodeWithSpec ¶
type OverflowCodeWithSpec struct { Code string `json:"code"` Spec *OverflowDeclarationInfo `json:"spec"` }
representing code with specification if parameters
type OverflowDeclarationInfo ¶
type OverflowDeclarationInfo struct { ParameterOrder []string `json:"order"` Parameters map[string]string `json:"parameters"` }
a type containing information about parameter types and orders
type OverflowEmulatorLogMessage ¶
type OverflowEmulatorLogMessage struct { ComputationUsed int `json:"computationUsed"` Level string `json:"level"` Msg string `json:"msg"` Time time.Time `json:"time"` TxID string `json:"txID"` }
OverflowEmulatorLogMessage a log message from the logrus implementation used in the flow emulator
type OverflowEvent ¶
type OverflowEvent map[string]interface{}
a type representing the terse output of an raw Flow Event
func (OverflowEvent) ExistIn ¶
func (o OverflowEvent) ExistIn(events []OverflowEvent) bool
Check if an event exist in the other events
type OverflowEventFetcherBuilder ¶
type OverflowEventFetcherBuilder struct { OverflowState *OverflowState EventsAndIgnoreFields OverflowEventFilter FromIndex int64 EndAtCurrentHeight bool EndIndex uint64 ProgressFile string NumberOfWorkers int EventBatchSize uint64 }
OverflowEventFetcherBuilder builder to hold info about eventhook context.
func (OverflowEventFetcherBuilder) BatchSize
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) BatchSize(batchSize uint64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
BatchSize sets the size of a batch
func (OverflowEventFetcherBuilder) End
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) End(blockHeight uint64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
End specify what index to end at
func (OverflowEventFetcherBuilder) Event
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Event(eventName string) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
Event fetches and Events and all its fields
func (OverflowEventFetcherBuilder) EventIgnoringFields
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) EventIgnoringFields(eventName string, ignoreFields []string) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
EventIgnoringFields fetch event and ignore the specified fields
func (OverflowEventFetcherBuilder) From
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) From(blockHeight int64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
From specify what blockHeight to fetch from. This can be negative related to end.
func (OverflowEventFetcherBuilder) Last
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Last(number uint64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
Last fetch events from the number last blocks
func (OverflowEventFetcherBuilder) Run
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Run() ([]*OverflowFormatedEvent, error)
Deprecated: Deprecated in favor of FetchEvent with builder
Run runs the eventfetcher returning events or an error
func (OverflowEventFetcherBuilder) Start
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Start(blockHeight int64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
Start specify what blockHeight to fetch starting atm. This can be negative related to end/until
func (OverflowEventFetcherBuilder) TrackProgressIn
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) TrackProgressIn(fileName string) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
TrackProgressIn Specify a file to store progress in
func (OverflowEventFetcherBuilder) Until
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Until(blockHeight uint64) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
Until specify what index to end at
func (OverflowEventFetcherBuilder) UntilCurrent
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) UntilCurrent() OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
UntilCurrent Specify to fetch events until the current Block
func (OverflowEventFetcherBuilder) Workers
deprecated
added in
v1.0.0
func (e OverflowEventFetcherBuilder) Workers(workers int) OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
Workers sets the number of workers.
type OverflowEventFetcherOption ¶
type OverflowEventFetcherOption func(*OverflowEventFetcherBuilder)
Event fetching
A function to customize the transaction builder
func WithBatchSize ¶
func WithBatchSize(size uint64) OverflowEventFetcherOption
Set the batch sice for FetchEvents
func WithEndIndex ¶
func WithEndIndex(blockHeight uint64) OverflowEventFetcherOption
set the end index to use
func WithEvent ¶
func WithEvent(eventName string) OverflowEventFetcherOption
set that we want to fetch an event and all its fields
func WithEventIgnoringField ¶
func WithEventIgnoringField(eventName string, ignoreFields []string) OverflowEventFetcherOption
set that we want the following events and ignoring the fields mentioned
func WithFromIndex ¶
func WithFromIndex(blockHeight int64) OverflowEventFetcherOption
set the from index to use alias to WithStartHeight
func WithLastBlocks ¶
func WithLastBlocks(number uint64) OverflowEventFetcherOption
set the relative list of blocks to fetch events from
func WithStartHeight ¶
func WithStartHeight(blockHeight int64) OverflowEventFetcherOption
set the start height to use
func WithTrackProgressIn ¶
func WithTrackProgressIn(fileName string) OverflowEventFetcherOption
track what block we have read since last run in a file
func WithUntilBlock ¶
func WithUntilBlock(blockHeight uint64) OverflowEventFetcherOption
fetch events until theg given height alias to WithEndHeight
func WithUntilCurrentBlock ¶
func WithUntilCurrentBlock() OverflowEventFetcherOption
set the end index to the current height
func WithWorkers ¶
func WithWorkers(workers int) OverflowEventFetcherOption
Set the Workers size for FetchEvents
type OverflowEventFilter ¶
Event parsing
a type alias to an OverflowEventFilter to filter out all events with a given suffix and the fields with given suffixes
type OverflowEvents ¶
type OverflowEvents map[string][]OverflowEvent
a type holding all events that are emitted from a Transaction
func (OverflowEvents) FilterEvents ¶
func (overflowEvents OverflowEvents) FilterEvents(ignoreFields OverflowEventFilter) OverflowEvents
Filter out events given the sent in filter
func (OverflowEvents) FilterFees ¶
func (overflowEvents OverflowEvents) FilterFees(fee float64) OverflowEvents
Filtter out fee events
func (OverflowEvents) FilterTempWithdrawDeposit ¶
func (overflowEvents OverflowEvents) FilterTempWithdrawDeposit() OverflowEvents
Filter out temp withdraw deposit events
func (OverflowEvents) Print ¶
func (overflowEvents OverflowEvents) Print(t *testing.T)
type OverflowFormatedEvent
deprecated
added in
v1.0.0
type OverflowFormatedEvent struct { Name string `json:"name"` BlockHeight uint64 `json:"blockHeight,omitempty"` Time time.Time `json:"time,omitempty"` Fields map[string]interface{} `json:"fields"` }
Deprecated: Deprecated in favor of FetchEvent with builder
OverflowFormatedEvent event in a more condensed formated form
func FormatEvents ¶ added in v1.0.0
func FormatEvents(blockEvents []flow.BlockEvents, ignoreFields map[string][]string) []*OverflowFormatedEvent
FormatEvents
func NewTestEvent
deprecated
added in
v1.0.0
func NewTestEvent(name string, fields map[string]interface{}) *OverflowFormatedEvent
Deprecated: Deprecated in favor of FetchEvent with builder
func ParseEvent ¶ added in v1.0.0
func ParseEvent(event flow.Event, blockHeight uint64, time time.Time, ignoreFields []string) *OverflowFormatedEvent
ParseEvent parses a flow event into a more terse representation
func (OverflowFormatedEvent) ExistIn
deprecated
added in
v1.0.0
func (o OverflowFormatedEvent) ExistIn(events []*OverflowFormatedEvent) bool
Deprecated: Deprecated in favor of FetchEvent with builder
func (OverflowFormatedEvent) GetFieldAsUInt64
deprecated
added in
v1.0.0
func (e OverflowFormatedEvent) GetFieldAsUInt64(field string) uint64
Deprecated: Deprecated in favor of FetchEvent with builder
func (OverflowFormatedEvent) ShortName
deprecated
added in
v1.0.0
func (fe OverflowFormatedEvent) ShortName() string
Deprecated: Deprecated in favor of FetchEvent with builder
func (OverflowFormatedEvent) String
deprecated
added in
v1.0.0
func (e OverflowFormatedEvent) String() string
Deprecated: Deprecated in favor of FetchEvent with builder
String pretty print an event as a String
type OverflowInteractionBuilder ¶
type OverflowInteractionBuilder struct { //the name of the integration, for inline variants Name string //force that this interaction will not print log, even if overflow state has specified it NoLog bool //The underlying state of overflow used to fetch some global settings Overflow *OverflowState //The file name of the interaction FileName string //The content of the interaction Content string //The list of raw arguments Arguments []cadence.Value //The main signer used to sign the transaction // Payer: the account paying for the transaction fees. Payer *flowkit.Account //The propser account // Proposer: the account that specifies a proposal key. Proposer *flowkit.Account //The payload signers that will sign the payload //Authorizers: zero or more accounts authorizing the transaction to mutate their state. PayloadSigners []*flowkit.Account //The gas limit to set for this given interaction GasLimit uint64 //The basepath on where to look for interactions BasePath string //An error object to store errors that arrive as you configure an interaction Error error //The code of the tranasction in bytes TransactionCode []byte //The named arguments NamedArgs map[string]interface{} //Event filters to apply to the interaction EventFilter OverflowEventFilter //Wheter to ignore global event filters from OverflowState or not IgnoreGlobalEventFilters bool //Options to use when printing results PrintOptions *[]OverflowPrinterOption }
OverflowInteractionBuilder used to create a builder pattern for an interaction
func (OverflowInteractionBuilder) Args
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) Args(args *OverflowArgumentsBuilder) OverflowInteractionBuilder
Deprecated: Use Arg
Specify arguments to send to transaction using a builder you send in
func (OverflowInteractionBuilder) ArgsFn
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) ArgsFn(fn func(*OverflowArgumentsBuilder)) OverflowInteractionBuilder
Deprecated: Use Arg
Specify arguments to send to transaction using a function that takes a builder where you call the builder
func (OverflowInteractionBuilder) ArgsV
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) ArgsV(args []cadence.Value) OverflowInteractionBuilder
Deprecated: Use Args
Specify arguments to send to transaction using a raw list of values
func (OverflowInteractionBuilder) Gas
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) Gas(limit uint64) OverflowInteractionBuilder
Deprecated: Use Tx function
Gas sets the gas limit for this transaction
func (OverflowInteractionBuilder) NamedArguments
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) NamedArguments(args map[string]string) OverflowInteractionBuilder
Deprecated: Use ArgM
func (OverflowInteractionBuilder) PayloadSigner
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) PayloadSigner(value string) OverflowInteractionBuilder
Deprecated: Use Tx function
PayloadSigner set a signer for the payload
func (OverflowInteractionBuilder) Run
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) Run() []flow.Event
Deprecated: use Send and get entire result
Run run the transaction
func (OverflowInteractionBuilder) RunE
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunE() ([]flow.Event, error)
Deprecated: use Send()
RunE runs returns events and error
func (OverflowInteractionBuilder) RunGetEventsWithName
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunGetEventsWithName(eventName string) []OverflowFormatedEvent
Deprecated: Use Send().GetEventsWithName()
func (OverflowInteractionBuilder) RunGetEventsWithNameOrError
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunGetEventsWithNameOrError(eventName string) ([]OverflowFormatedEvent, error)
Deprecated: use Tx().GetEventsWithName
func (OverflowInteractionBuilder) RunGetIdFromEvent ¶ added in v1.0.0
func (t OverflowInteractionBuilder) RunGetIdFromEvent(eventName string, fieldName string) uint64
Deprecated, use Send().GetIdFromEvent
func (OverflowInteractionBuilder) RunGetIdFromEventPrintAll
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunGetIdFromEventPrintAll(eventName string, fieldName string) uint64
Deprecated: Use Tx().Print().GetIdFromEvent
func (OverflowInteractionBuilder) RunPrintEvents
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunPrintEvents(ignoreFields map[string][]string)
Deprecated: use Send().PrintEventsFiltered()
RunPrintEvents will run a transaction and print all events ignoring some fields
func (OverflowInteractionBuilder) RunPrintEventsFull
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) RunPrintEventsFull()
Deprecated: use Send().PrintEvents()
RunPrintEventsFull will run a transaction and print all events
func (OverflowInteractionBuilder) Send ¶
func (oib OverflowInteractionBuilder) Send() *OverflowResult
Send a interaction builder as a Transaction returning an overflow result
func (OverflowInteractionBuilder) SignProposeAndPayAs
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) SignProposeAndPayAs(signer string) OverflowInteractionBuilder
Deprecated: Use Tx function
SignProposeAndPayAs set the payer, proposer and envelope signer
func (OverflowInteractionBuilder) SignProposeAndPayAsService
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) SignProposeAndPayAsService() OverflowInteractionBuilder
Deprecated: Use Tx function
SignProposeAndPayAsService set the payer, proposer and envelope signer
func (OverflowInteractionBuilder) Test
deprecated
added in
v1.0.0
func (f OverflowInteractionBuilder) Test(t *testing.T) OverflowTransactionResult
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (OverflowInteractionBuilder) TransactionPath
deprecated
added in
v1.0.0
func (t OverflowInteractionBuilder) TransactionPath(path string) OverflowInteractionBuilder
Deprecated: Use Tx function
type OverflowInteractionOption ¶
type OverflowInteractionOption func(*OverflowInteractionBuilder)
A function to customize the transaction builder
func WithAddresses ¶
func WithAddresses(name string, value ...string) OverflowInteractionOption
Send in an array of addresses as an argument
func WithArg ¶
func WithArg(name string, value interface{}) OverflowInteractionOption
Send an argument into a transaction
The value is treated in the given way depending on type - cadence.Value is sent as straight argument - string argument are resolved into cadence.Value using flowkit - ofther values are converted to string with %v and resolved into cadence.Value using flowkit - if the type of the parameter is Address and the string you send in is a valid account in flow.json it will resolve
func WithArgDateTime ¶
func WithArgDateTime(name string, dateString string, timezone string) OverflowInteractionOption
sending in a timestamp as an arg is quite complicated, use this method with the name of the arg, the datestring and the given timezone to parse it at
func WithArgs ¶
func WithArgs(args ...interface{}) OverflowInteractionOption
set a list of args as key, value in an interaction, see Arg for options you can pass in
func WithArgsMap ¶
func WithArgsMap(args map[string]interface{}) OverflowInteractionOption
set arguments to the interaction from a map. See Arg for options on what you can pass in
func WithEventsFilter ¶
func WithEventsFilter(filter OverflowEventFilter) OverflowInteractionOption
set a filter for events
func WithName ¶
func WithName(name string) OverflowInteractionOption
set the name of this interaction, for inline interactions this will be the entire name for file interactions they will be combined
func WithPayloadSigner ¶
func WithPayloadSigner(signer ...string) OverflowInteractionOption
set an aditional authorizer that will sign the payload
func WithPrintOptions ¶
func WithPrintOptions(opts ...OverflowPrinterOption) OverflowInteractionOption
print interactions using the following options
func WithProposerServiceAccount ¶
func WithProposerServiceAccount() OverflowInteractionOption
set the propser to be the service account
func WithSigner ¶
func WithSigner(signer string) OverflowInteractionOption
set payer, proposer authorizer as the signer
func WithSignerServiceAccount ¶
func WithSignerServiceAccount() OverflowInteractionOption
set service account as payer, proposer, authorizer
func WithoutGlobalEventFilter ¶
func WithoutGlobalEventFilter() OverflowInteractionOption
ignore global events filters defined on OverflowState
func WithoutLog ¶
func WithoutLog() OverflowInteractionOption
force no printing for this interaction
type OverflowMeter ¶
type OverflowMeter struct { LedgerInteractionUsed int `json:"ledgerInteractionUsed"` ComputationUsed int `json:"computationUsed"` MemoryUsed int `json:"memoryUsed"` ComputationIntensities OverflowMeteredComputationIntensities `json:"computationIntensities"` MemoryIntensities OverflowMeteredMemoryIntensities `json:"memoryIntensities"` }
a type representing a meter that contains information about the inner workings of an interaction, only available on local emulator
func (OverflowMeter) FunctionInvocations ¶
func (m OverflowMeter) FunctionInvocations() int
get the number of functions invocations
func (OverflowMeter) Statements ¶
func (m OverflowMeter) Statements() int
get the number of statements
type OverflowMeteredComputationIntensities ¶
type OverflowMeteredComputationIntensities map[common.ComputationKind]uint
type collecting computatationIntensities
type OverflowMeteredMemoryIntensities ¶
type OverflowMeteredMemoryIntensities map[common.MemoryKind]uint
type collecting memoryIntensities
type OverflowOption ¶
type OverflowOption func(*OverflowBuilder)
OverflowOption and option function that you can send in to configure Overflow
func WithBasePath ¶
func WithBasePath(path string) OverflowOption
WithBasePath will change the standard basepath `.` to another folder
func WithEmptyDepositWithdrawEvents ¶
func WithEmptyDepositWithdrawEvents() OverflowOption
filter out empty deposit and withdraw events
func WithExistingEmulator ¶
func WithExistingEmulator() OverflowOption
WithExistingEmulator will attach to an existing emulator, not deploying contracts and creating accounts
func WithFeesEvents ¶
func WithFeesEvents() OverflowOption
WithTransactionFolderName will overwite the default script subdir for transactions `transactions`
func WithFlowConfig ¶
func WithFlowConfig(files ...string) OverflowOption
WithFlowConfig will set the path to one or more flow.json config files The default is ~/flow.json and ./flow.json.
func WithFlowForNewUsers ¶
func WithFlowForNewUsers(amount float64) OverflowOption
Set the amount of flow for new account, default is 0.001
func WithGas ¶
func WithGas(gas int) OverflowOption
WithGas set the default gas limit, standard is 9999 (max)
func WithGlobalEventFilter ¶
func WithGlobalEventFilter(filter OverflowEventFilter) OverflowOption
set global filters to events
func WithGlobalPrintOptions ¶
func WithGlobalPrintOptions(opts ...OverflowPrinterOption) OverflowOption
automatically print interactions using the following options
func WithLogFull ¶
func WithLogFull() OverflowOption
func WithLogInfo ¶
func WithLogInfo() OverflowOption
func WithLogNone ¶
func WithLogNone() OverflowOption
WithNoLog will not log anything from results or flowkit logger
func WithNetwork ¶
func WithNetwork(network string) OverflowOption
WithNetwork will start overflow with the given network. This function will also set up other options that are common for a given Network. embedded: starts in memory, will deploy contracts and create accounts, will panic on errors and show terse output testing: as embedeed, but will not stop on errors and turn off all logs emulator: will connect to running local emulator, deploy contracts and create account testnet|mainnet: will only set network, not deploy contracts or create accounts
func WithNoPrefixToAccountNames ¶
func WithNoPrefixToAccountNames() OverflowOption
DoNotPrependNetworkToAccountNames will not prepend the name of the network to account names
func WithPanicOnError ¶
func WithPanicOnError() OverflowOption
If this option is used a panic will be called if an error occurs after an interaction is run
func WithScriptFolderName ¶
func WithScriptFolderName(name string) OverflowOption
WithScriptFolderName will overwite the default script subdir for scripts `scripts`
func WithServiceAccountSuffix ¶
func WithServiceAccountSuffix(suffix string) OverflowOption
WithServiceAccountSuffix will set the suffix of the service account
func WithTransactionFolderName ¶
func WithTransactionFolderName(name string) OverflowOption
WithTransactionFolderName will overwite the default script subdir for transactions `transactions`
type OverflowPastEvent ¶
type OverflowPastEvent struct { Name string `json:"name"` BlockHeight uint64 `json:"blockHeight,omitempty"` Time time.Time `json:"time,omitempty"` Fields OverflowEvent `json:"fields"` }
a type to represent an event that we get from FetchEvents
func (OverflowPastEvent) GetFieldAsUInt64 ¶
func (e OverflowPastEvent) GetFieldAsUInt64(field string) uint64
get the given field as an uint64
func (OverflowPastEvent) String ¶
func (e OverflowPastEvent) String() string
String pretty print an event as a String
type OverflowPrinterBuilder ¶
type OverflowPrinterBuilder struct { //set to false to disable all events Events bool //filter out some events EventFilter OverflowEventFilter //0 to print no meter, 1 to print some, 2 to pritn all NB verbose Meter int //print the emulator log, NB! Verbose EmulatorLog bool //print transaction id, useful to disable in tests Id bool }
a type representing the accuumlated state in the builder
the default setting is to print one line for each transaction with meter and all events
type OverflowPrinterOption ¶
type OverflowPrinterOption func(*OverflowPrinterBuilder)
a type represneting seting an obtion in the printer builder
func WithEmulatorLog ¶
func WithEmulatorLog() OverflowPrinterOption
print the emulator log. NB! Verbose
func WithEventFilter ¶
func WithEventFilter(filter OverflowEventFilter) OverflowPrinterOption
filter out events that are printed
func WithMeter ¶
func WithMeter() OverflowPrinterOption
print meters as part of the transaction output line
func WithoutId ¶
func WithoutId() OverflowPrinterOption
type OverflowResult ¶
type OverflowResult struct { StopOnError bool //The error if any Err error //The id of the transaction Id flow.Identifier //If running on an emulator //the meter that contains useful debug information on memory and interactions Meter *OverflowMeter //The Raw log from the emulator RawLog []OverflowEmulatorLogMessage // The log from the emulator EmulatorLog []string //The computation used ComputationUsed int //The raw unfiltered events RawEvents []flow.Event //Events that are filtered and parsed into a terse format Events OverflowEvents //The underlying transaction if we need to look into that Transaction *flow.Transaction //TODO: consider marshalling this as a struct for convenience //The fee event if any Fee map[string]interface{} FeeGas int //The name of the Transaction Name string }
OverflowResult represents the state after running an transaction
func (OverflowResult) AssertComputationLessThenOrEqual ¶
func (o OverflowResult) AssertComputationLessThenOrEqual(t *testing.T, computation int) OverflowResult
Assert that this transaction did not use more then the given amount of computation
func (OverflowResult) AssertComputationUsed ¶
func (o OverflowResult) AssertComputationUsed(t *testing.T, computation int) OverflowResult
Assert that the transaction uses exactly the given computation amount
func (OverflowResult) AssertDebugLog ¶
func (o OverflowResult) AssertDebugLog(t *testing.T, message ...string) OverflowResult
Assert that a Debug.Log event was emitted that contains the given messages
func (OverflowResult) AssertEmitEventName ¶
func (o OverflowResult) AssertEmitEventName(t *testing.T, event ...string) OverflowResult
Assert that events with the given suffixes are present
func (OverflowResult) AssertEmulatorLog ¶
func (o OverflowResult) AssertEmulatorLog(t *testing.T, message string) OverflowResult
Assert that the internal log of the emulator contains the given message
func (OverflowResult) AssertEvent ¶
func (o OverflowResult) AssertEvent(t *testing.T, name string, fields OverflowEvent) OverflowResult
Assert that the event with the given name suffix and fields are present
func (OverflowResult) AssertEventCount ¶
func (o OverflowResult) AssertEventCount(t *testing.T, number int) OverflowResult
Assert that the transaction result contains the amount of events
func (OverflowResult) AssertFailure ¶
func (o OverflowResult) AssertFailure(t *testing.T, msg string) OverflowResult
Assert that this particular transaction was a failure that has a message that contains the sendt in assertion
func (OverflowResult) AssertNoEvents ¶
func (o OverflowResult) AssertNoEvents(t *testing.T) OverflowResult
Assert that this transaction emitted no events
func (OverflowResult) AssertSuccess ¶
func (o OverflowResult) AssertSuccess(t *testing.T) OverflowResult
Assert that this transaction was an success
func (OverflowResult) GetEventsWithName ¶
func (o OverflowResult) GetEventsWithName(eventName string) []OverflowEvent
Get all events that end with the given suffix
func (OverflowResult) GetIdFromEvent ¶
func (o OverflowResult) GetIdFromEvent(eventName string, fieldName string) (uint64, error)
Get a uint64 field with the given fieldname(most often an id) from an event with a given suffix
func (OverflowResult) GetIdsFromEvent ¶
func (o OverflowResult) GetIdsFromEvent(eventName string, fieldName string) []uint64
func (OverflowResult) Print ¶
func (o OverflowResult) Print(opbs ...OverflowPrinterOption) OverflowResult
print out an result
type OverflowScriptBuilder
deprecated
added in
v1.0.0
type OverflowScriptBuilder struct { Overflow *OverflowState FileName string Arguments []cadence.Value ScriptAsString string BasePath string Error error }
OverflowScriptBuilder is a struct to hold information for running a script
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) Args
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) Args(args *OverflowArgumentsBuilder) OverflowScriptBuilder
Specify arguments to send to transaction using a builder you send in
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) ArgsFn
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) ArgsFn(fn func(*OverflowArgumentsBuilder)) OverflowScriptBuilder
Specify arguments to send to transaction using a function that takes a builder where you call the builder
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) ArgsV
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) ArgsV(args []cadence.Value) OverflowScriptBuilder
Specify arguments to send to transaction using a raw list of values
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) NamedArguments
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) NamedArguments(args map[string]string) OverflowScriptBuilder
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) Run ¶ added in v1.0.0
func (t OverflowScriptBuilder) Run()
Run executes a read only script Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) RunFailOnError
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) RunFailOnError() cadence.Value
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) RunMarshalAs
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) RunMarshalAs(value interface{}) error
RunMarshalAs runs the script and marshals the result into the provided value, returning an error if any
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) RunReturns
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) RunReturns() (cadence.Value, error)
RunReturns executes a read only script
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) RunReturnsInterface
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) RunReturnsInterface() interface{}
RunReturnsInterface runs the script and returns interface{}
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) RunReturnsJsonString
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) RunReturnsJsonString() string
RunReturnsJsonString runs the script and returns pretty printed json string
Deprecated: use FlowInteractionBuilder and the Script method
func (OverflowScriptBuilder) ScriptPath
deprecated
added in
v1.0.0
func (t OverflowScriptBuilder) ScriptPath(path string) OverflowScriptBuilder
Deprecated: use FlowInteractionBuilder and the Script method
type OverflowScriptFunction ¶
type OverflowScriptFunction func(filename string, opts ...OverflowInteractionOption) *OverflowScriptResult
a type used for composing scripts
type OverflowScriptOptsFunction ¶
type OverflowScriptOptsFunction func(opts ...OverflowInteractionOption) *OverflowScriptResult
a type used for composing scripts
type OverflowScriptResult ¶
type OverflowScriptResult struct { Err error Result cadence.Value Input *OverflowInteractionBuilder Log []OverflowEmulatorLogMessage Output interface{} }
result after running a script
func (*OverflowScriptResult) AssertLengthWithPointer ¶
func (osr *OverflowScriptResult) AssertLengthWithPointer(t *testing.T, pointer string, length int) *OverflowScriptResult
Assert that the length of a jsonPointer is equal to length
func (*OverflowScriptResult) AssertWant ¶
func (osr *OverflowScriptResult) AssertWant(t *testing.T, want autogold.Value) *OverflowScriptResult
Assert that the result is equal to the given autogold.Want
func (*OverflowScriptResult) AssertWithPointer ¶
func (osr *OverflowScriptResult) AssertWithPointer(t *testing.T, pointer string, value interface{}) *OverflowScriptResult
Assert that a jsonPointer into the result is equal to the given value
func (*OverflowScriptResult) AssertWithPointerError ¶
func (osr *OverflowScriptResult) AssertWithPointerError(t *testing.T, pointer string, message string) *OverflowScriptResult
Assert that a jsonPointer into the result is an error
func (*OverflowScriptResult) AssertWithPointerWant ¶
func (osr *OverflowScriptResult) AssertWithPointerWant(t *testing.T, pointer string, want autogold.Value) *OverflowScriptResult
Assert that a jsonPointer into the result is equal to the given autogold Want
func (*OverflowScriptResult) GetAsInterface ¶
func (osr *OverflowScriptResult) GetAsInterface() (interface{}, error)
get the script as interface{}
func (*OverflowScriptResult) GetAsJson ¶
func (osr *OverflowScriptResult) GetAsJson() (string, error)
get the script as json
func (*OverflowScriptResult) GetWithPointer ¶
func (osr *OverflowScriptResult) GetWithPointer(pointer string) (interface{}, error)
get the given jsonPointer as interface{}
func (*OverflowScriptResult) MarshalAs ¶
func (osr *OverflowScriptResult) MarshalAs(marshalTo interface{}) error
Marshal the script output as the given sent in type
func (*OverflowScriptResult) MarshalPointerAs ¶
func (osr *OverflowScriptResult) MarshalPointerAs(pointer string, marshalTo interface{}) error
Marshal the given jsonPointer as the given type
func (*OverflowScriptResult) Print ¶
func (osr *OverflowScriptResult) Print() *OverflowScriptResult
Print the result
type OverflowSolution ¶
type OverflowSolution struct { //all transactions with name and what paremters they have Transactions map[string]*OverflowDeclarationInfo `json:"transactions"` //all scripts with name and parameter they have Scripts map[string]*OverflowDeclarationInfo `json:"scripts"` //all networks with associated scripts/tranasctions/contracts preresolved Networks map[string]*OverflowSolutionNetwork `json:"networks"` //warnings accumulated during parsing Warnings []string `json:"warnings"` }
a type representing the raw solutions that contains all transactions, scripts, networks and warnings of any
func (*OverflowSolution) MergeSpecAndCode ¶
func (s *OverflowSolution) MergeSpecAndCode() *OverflowSolutionMerged
merge the given Solution into a MergedSolution that is suited for exposing as an NPM module
type OverflowSolutionMerged ¶
type OverflowSolutionMerged struct {
Networks map[string]OverflowSolutionMergedNetwork `json:"networks"`
}
a type representing a merged solution that will be serialized as the json file for the npm module
type OverflowSolutionMergedNetwork ¶
type OverflowSolutionMergedNetwork struct { Scripts map[string]OverflowCodeWithSpec `json:"scripts"` Transactions map[string]OverflowCodeWithSpec `json:"transactions,omitempty"` Contracts *map[string]string `json:"contracts,omitempty"` }
a network in the merged solution
type OverflowSolutionNetwork ¶
type OverflowSolutionNetwork struct { Scripts map[string]string `json:"scripts"` Transactions map[string]string `json:"transactions,omitempty"` Contracts *map[string]string `json:"contracts,omitempty"` }
a type representing one network in a solution, so mainnet/testnet/emulator
type OverflowState ¶
type OverflowState struct { //State is the current state of the configured overflow instance State *flowkit.State //the services from flowkit to performed operations on Services *services.Services //Configured variables that are taken from the builder since we need them in the execution of overflow later on Network string PrependNetworkToAccountNames bool ServiceAccountSuffix string Gas int //flowkit, emulator and emulator debug log uses three different logging technologies so we have them all stored here //this flowkit Logger can go away when we can remove deprecations! Logger output.Logger Log *bytes.Buffer LogLevel int //https://github.com/bjartek/overflow/issues/45 //This is not populated with anything yet since the emulator version that has this change is not in mainline yet EmulatorLog *bytes.Buffer //If there was an error starting overflow it is stored here Error error //Paths that points to where .cdc files are stored and the posibilty to specify something besides the standard `transactions`/`scripts`subdirectories BasePath string TransactionBasePath string ScriptBasePath string //Filters to events to remove uneeded noise FilterOutFeeEvents bool FilterOutEmptyWithDrawDepositEvents bool GlobalEventFilter OverflowEventFilter //Signal to overflow that if there is an error after running a single interaction we should panic StopOnError bool //Signal to overflow that if this is not nil we should print events on interaction completion PrintOptions *[]OverflowPrinterOption //Mint this amount of flow to new accounts NewUserFlowAmount float64 }
OverflowState contains information about how to Overflow is confitured and the current runnig state
func Overflow ¶
func Overflow(opts ...OverflowOption) *OverflowState
Overflow will start an Overflow instance that panics if there are initialization errors
Will read the following ENV vars as default: OVERFLOW_ENV : set to "mainnet|testnet|emulator|embedded", default embedded OVERFLOW_LOGGING: set from 0-3. 0 is silent, 1 is print terse output, 2 is print output from flowkit, 3 is all lots we can OVERFLOW_CONTINUE: to continue this overflow on an already running emulator., default false OVERFLOW_STOP_ON_ERROR: will the process panic if an erorr is encountered. If set to false the result objects will have the error. default: false
Starting overflow without env vars will make it start in embedded mode deploying all contracts creating accounts ¶
You can then chose to override this setting with the builder methods example
Overflow(WithNetwork("mainnet"))
func OverflowTesting ¶
func OverflowTesting(opts ...OverflowOption) (*OverflowState, error)
func (*OverflowState) Account ¶
func (o *OverflowState) Account(key string) *flowkit.Account
return the account of a given account
func (*OverflowState) AccountE ¶
func (o *OverflowState) AccountE(key string) (*flowkit.Account, error)
AccountE fetch an account from State Note that if `PrependNetworkToAccountNames` is specified it is prefixed with the network so that you can use the same logical name across networks
func (*OverflowState) Address ¶
func (o *OverflowState) Address(key string) string
return the address of an given account
func (*OverflowState) Arguments
deprecated
added in
v1.0.0
func (o *OverflowState) Arguments() *OverflowArgumentsBuilder
Deprecated: This builder and all its methods are deprecated. Use the new Tx/Script methods and its argument method
func (*OverflowState) BuildInteraction ¶
func (o *OverflowState) BuildInteraction(filename string, interactionType string, opts ...OverflowInteractionOption) *OverflowInteractionBuilder
create a flowInteractionBuilder from the sent in options
func (*OverflowState) CreateAccountsE ¶
func (o *OverflowState) CreateAccountsE() (*OverflowState, error)
CreateAccountsE ensures that all accounts present in the deployment block for the given network is present
func (*OverflowState) DownloadAndUploadFile ¶
func (o *OverflowState) DownloadAndUploadFile(url string, accountName string) error
DownloadAndUploadFile reads a file, base64 encodes it and chunk upload to /storage/upload
func (*OverflowState) DownloadImageAndUploadAsDataUrl ¶
func (o *OverflowState) DownloadImageAndUploadAsDataUrl(url, accountName string) error
DownloadImageAndUploadAsDataUrl download an image and upload as data url
func (*OverflowState) EventFetcher
deprecated
added in
v1.0.0
func (o *OverflowState) EventFetcher() OverflowEventFetcherBuilder
Deprecated: Deprecated in favor of FetchEvent with builder
EventFetcher create an event fetcher builder.
func (*OverflowState) FetchEvents ¶
func (o *OverflowState) FetchEvents(opts ...OverflowEventFetcherOption) ([]OverflowPastEvent, error)
FetchEvents using the given options
func (*OverflowState) FillUpStorage ¶
func (o *OverflowState) FillUpStorage(accountName string) *OverflowState
A method to fill up a users storage, useful when testing This has some issues with transaction fees
func (*OverflowState) GetAccount ¶
func (o *OverflowState) GetAccount(key string) (*flow.Account, error)
GetAccount takes the account name and returns the state of that account on the given network.
func (*OverflowState) GetBlockAtHeight ¶
func (o *OverflowState) GetBlockAtHeight(height uint64) (*flow.Block, error)
get block at a given height
func (*OverflowState) GetBlockById ¶
func (o *OverflowState) GetBlockById(blockId string) (*flow.Block, error)
blockId should be a hexadecimal string
func (*OverflowState) GetFreeCapacity ¶
func (o *OverflowState) GetFreeCapacity(accountName string) int
Get the free capacity in an account
func (*OverflowState) GetLatestBlock ¶
func (o *OverflowState) GetLatestBlock() (*flow.Block, error)
get the latest block
func (*OverflowState) InitializeContracts ¶
func (o *OverflowState) InitializeContracts() *OverflowState
InitializeContracts installs all contracts in the deployment block for the configured network
func (*OverflowState) InlineScript
deprecated
added in
v1.0.0
func (o *OverflowState) InlineScript(content string) OverflowScriptBuilder
Script start a script builder with the inline script as body
Deprecated: use FlowInteractionBuilder and the Script method
func (*OverflowState) MintFlowTokens ¶
func (o *OverflowState) MintFlowTokens(accountName string, amount float64) *OverflowState
func (*OverflowState) ParseAll ¶
func (o *OverflowState) ParseAll() (*OverflowSolution, error)
Parse the given overflow state into a solution/npm-module
func (*OverflowState) ParseAllWithConfig ¶
func (o *OverflowState) ParseAllWithConfig(skipContracts bool, txSkip []string, scriptSkip []string) (*OverflowSolution, error)
Parse the gieven overflow state with filters
func (*OverflowState) ParseArgumentsWithoutType
deprecated
added in
v1.0.0
func (*OverflowState) Script ¶
func (o *OverflowState) Script(filename string, opts ...OverflowInteractionOption) *OverflowScriptResult
run a script with the given code/filanem an options
Example ¶
o := Overflow(docOptions) // the other major interaction you can run on Flow is a script, it uses the script DSL. // Start it by specifying the script name from `scripts` folder o.Script("test", // the test script requires an address as arguments, Overflow is smart enough that it // sees this and knows that there is an account for the emulator network called // `emulator-first` so it will insert that address as the argument. // If you change the network to testnet/mainnet later and name your stakholders // accordingly it will just work WithArg("account", "first"), )
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00 ⭐ Script test run result:"0x01cf0e2f2f715450"
Example (Inline) ¶
o := Overflow(docOptions) //Script can be run inline o.Script(` pub fun main(account: Address): String { return getAccount(account).address.toString() }`, WithArg("account", "first"), WithName("get_address"), )
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00 ⭐ Script get_address run result:"0x01cf0e2f2f715450"
func (*OverflowState) ScriptFN ¶
func (o *OverflowState) ScriptFN(outerOpts ...OverflowInteractionOption) OverflowScriptFunction
compose interactionOptions into a new Script function
func (*OverflowState) ScriptFileNameFN ¶
func (o *OverflowState) ScriptFileNameFN(filename string, outerOpts ...OverflowInteractionOption) OverflowScriptOptsFunction
compose fileName and interactionOptions into a new Script function
func (*OverflowState) ScriptFromFile
deprecated
added in
v1.0.0
func (o *OverflowState) ScriptFromFile(filename string) OverflowScriptBuilder
ScriptFromFile will start a flow script builder
Deprecated: use FlowInteractionBuilder and the Script method
func (*OverflowState) ServiceAccountName ¶
func (o *OverflowState) ServiceAccountName() string
ServiceAccountName return the name of the current service account Note that if `PrependNetworkToAccountNames` is specified it is prefixed with the network so that you can use the same logical name across networks
func (*OverflowState) SignUserMessage ¶
func (o *OverflowState) SignUserMessage(account string, message string) (string, error)
Sign a user message
func (*OverflowState) SimpleTxArgs
deprecated
added in
v1.0.0
func (o *OverflowState) SimpleTxArgs(filename string, signer string, args *OverflowArgumentsBuilder)
Deprecated: Use Tx()
func (*OverflowState) Transaction
deprecated
added in
v1.0.0
func (o *OverflowState) Transaction(content string) OverflowInteractionBuilder
Deprecated: Use Tx()
Transaction will start a flow transaction builder using the inline transaction
func (*OverflowState) TransactionFromFile
deprecated
added in
v1.0.0
func (o *OverflowState) TransactionFromFile(filename string) OverflowInteractionBuilder
Deprecated: Use Tx()
TransactionFromFile will start a flow transaction builder
func (*OverflowState) Tx ¶
func (o *OverflowState) Tx(filename string, opts ...OverflowInteractionOption) *OverflowResult
The main function for running an transasction in overflow
Example ¶
o := Overflow(docOptions) // start the Tx DSL with the name of the transactions file, by default this // is in the `transactions` folder in your root dit o.Tx("arguments", //Customize the Transaction by sending in more InteractionOptions, //at minimum you need to set Signer and Args if any WithSigner("first"), //Arguments are always passed by name in the DSL builder, order does not matter WithArg("test", "overflow ftw!"), )
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00 👌 Tx:arguments fee:0.00000244 gas:29
Example (Inline) ¶
o := Overflow(docOptions) //The Tx dsl can also contain an inline transaction o.Tx(` import Debug from "../contracts/Debug.cdc" transaction(message:String) { prepare(acct: AuthAccount) { Debug.log(message) } }`, WithSigner("first"), WithArg("message", "overflow ftw!"), )
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00 👌 Tx: fee:0.00000284 gas:37 === Events === A.f8d6e0586b0a20c7.Debug.Log msg -> overflow ftw!
Example (Multisign) ¶
o := Overflow(docOptions) //The Tx dsl supports multiple signers, note that the mainSigner is the last account o.Tx(` import Debug from "../contracts/Debug.cdc" transaction { prepare(acct: AuthAccount, acct2: AuthAccount) { Debug.log("acct:".concat(acct.address.toString())) Debug.log("acct2:".concat(acct2.address.toString())) } }`, WithSigner("first"), WithPayloadSigner("second"), )
Output: 📜 deploy contracts NonFungibleToken, Debug 🧑 Created account: emulator-first with address: 01cf0e2f2f715450 with flow: 10.00 🧑 Created account: emulator-second with address: 179b6b1cb6755e31 with flow: 10.00 👌 Tx: fee:0.00000284 gas:37 === Events === A.f8d6e0586b0a20c7.Debug.Log msg -> acct:0x179b6b1cb6755e31 A.f8d6e0586b0a20c7.Debug.Log msg -> acct2:0x01cf0e2f2f715450
func (*OverflowState) TxFN ¶
func (o *OverflowState) TxFN(outerOpts ...OverflowInteractionOption) OverflowTransactionFunction
If you store this in a struct and add arguments to it it will not reset between calls
func (*OverflowState) TxFileNameFN ¶
func (o *OverflowState) TxFileNameFN(filename string, outerOpts ...OverflowInteractionOption) OverflowTransactionOptsFunction
func (*OverflowState) UploadFile ¶
func (o *OverflowState) UploadFile(filename string, accountName string) error
UploadFile reads a file, base64 encodes it and chunk upload to /storage/upload
func (*OverflowState) UploadImageAsDataUrl ¶
func (o *OverflowState) UploadImageAsDataUrl(filename string, accountName string) error
UploadImageAsDataUrl will upload a image file from the filesystem into /storage/upload of the given account
func (*OverflowState) UploadString ¶
func (o *OverflowState) UploadString(content string, accountName string) error
UploadString will upload the given string data in 1mb chunkts to /storage/upload of the given account
type OverflowTransactionFunction ¶
type OverflowTransactionFunction func(filename string, opts ...OverflowInteractionOption) *OverflowResult
a type to define a function used to compose Transaction interactions
type OverflowTransactionOptsFunction ¶
type OverflowTransactionOptsFunction func(opts ...OverflowInteractionOption) *OverflowResult
a type to define a function used to compose Transaction interactions
type OverflowTransactionResult
deprecated
added in
v1.0.0
type OverflowTransactionResult struct { Err error Events []*OverflowFormatedEvent Result *OverflowResult Testing *testing.T }
OverflowTransactionResult
The old result object from an transaction ¶
Deprecated: use the new Tx() method and OverflowResult
func (OverflowTransactionResult) AssertComputationLessThenOrEqual
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertComputationLessThenOrEqual(computation int) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertComputationUsed
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertComputationUsed(computation int) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertDebugLog
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertDebugLog(message ...string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEmitEvent
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEmitEvent(event ...*OverflowFormatedEvent) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEmitEventJson
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEmitEventJson(event ...string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEmitEventName
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEmitEventName(event ...string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEmitEventNameShortForm
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEmitEventNameShortForm(event ...string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEmulatorLog
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEmulatorLog(message string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertEventCount
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertEventCount(number int) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertFailure
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertFailure(msg string) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertNoEvents
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertNoEvents() OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertPartialEvent
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertPartialEvent(expected *OverflowFormatedEvent) OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) AssertSuccess
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) AssertSuccess() OverflowTransactionResult
Deprecated: use the new Tx() method and Asserts on the result
func (OverflowTransactionResult) GetIdFromEvent
deprecated
added in
v1.0.0
func (t OverflowTransactionResult) GetIdFromEvent(eventName string, fieldName string) uint64
Deprecated: use the new Tx() method and Asserts on the result