sbtestsc

package
v1.3.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

smart contract for testing

Index

Constants

View Source
const (
	// State variables
	VarCounter              = "counter"
	VarContractNameDeployed = "exampleDeployTR"

	// parameters
	ParamAddress                          = "address"
	ParamAgentID                          = "agentID"
	ParamCaller                           = "caller"
	ParamChainID                          = "chainID"
	ParamChainOwnerID                     = "chainOwnerID"
	ParamGasReserve                       = "gasReserve"
	ParamGasReserveTransferAccountToChain = "gasReserveTransferAccountToChain"
	ParamContractID                       = "contractID"
	ParamFail                             = "initFailParam"
	ParamHnameContract                    = "hnameContract"
	ParamHnameEP                          = "hnameEP"
	ParamIntParamName                     = "intParamName"
	ParamIntParamValue                    = "intParamValue"
	ParamBaseTokens                       = "baseTokens"
	ParamN                                = "n"
	ParamProgHash                         = "progHash"
	ParamSize                             = "size"

	// error fragments for testing
	MsgDoNothing = "========== doing nothing =========="
	MsgFullPanic = "========== panic FULL ENTRY POINT =========="
	MsgViewPanic = "========== panic VIEW =========="
)

Variables

View Source
var (
	// function eventlog test
	FuncEventLogGenericData = coreutil.Func("testEventLogGenericData")
	FuncEventLogEventData   = coreutil.Func("testEventLogEventData")
	FuncEventLogDeploy      = coreutil.Func("testEventLogDeploy")

	// Function sandbox test
	FuncChainOwnerIDView = coreutil.ViewFunc("testChainOwnerIDView")
	FuncChainOwnerIDFull = coreutil.Func("testChainOwnerIDFull")

	FuncSandboxCall            = coreutil.ViewFunc("testSandboxCall")
	FuncCheckContextFromFullEP = coreutil.Func("checkContextFromFullEP")
	FuncCheckContextFromViewEP = coreutil.ViewFunc("checkContextFromViewEP")

	FuncTestCustomError         = coreutil.Func("testCustomError")
	FuncPanicFullEP             = coreutil.Func("testPanicFullEP")
	FuncPanicViewEP             = coreutil.ViewFunc("testPanicViewEP")
	FuncCallPanicFullEP         = coreutil.Func("testCallPanicFullEP")
	FuncCallPanicViewEPFromFull = coreutil.Func("testCallPanicViewEPFromFull")
	FuncCallPanicViewEPFromView = coreutil.ViewFunc("testCallPanicViewEPFromView")

	FuncWithdrawFromChain = coreutil.Func("withdrawFromChain")

	FuncDoNothing = coreutil.Func("doNothing")
	// FuncSendToAddress = coreutil.Func("sendToAddress")
	FuncJustView = coreutil.ViewFunc("justView")

	FuncCallOnChain                     = coreutil.Func("callOnChain")
	FuncSetInt                          = coreutil.Func("setInt")
	FuncGetInt                          = coreutil.ViewFunc("getInt")
	FuncGetFibonacci                    = coreutil.ViewFunc("fibonacci")
	FuncGetFibonacciIndirect            = coreutil.ViewFunc("fibonacciIndirect")
	FuncCalcFibonacciIndirectStoreValue = coreutil.Func("calcFibonacciIndirectStoreValue")
	FuncViewCalcFibonacciResult         = coreutil.ViewFunc("getFibCalcResult")
	FuncGetCounter                      = coreutil.ViewFunc("getCounter")
	FuncIncCounter                      = coreutil.Func("incCounter")
	FuncRunRecursion                    = coreutil.Func("runRecursion")

	FuncPassTypesFull = coreutil.Func("passTypesFull")
	FuncPassTypesView = coreutil.ViewFunc("passTypesView")

	FuncSpawn = coreutil.Func("spawn")

	FuncSplitFunds                = coreutil.Func("splitFunds")
	FuncSplitFundsNativeTokens    = coreutil.Func("splitFundsNativeTokens")
	FuncPingAllowanceBack         = coreutil.Func("pingAllowanceBack")
	FuncSendLargeRequest          = coreutil.Func("sendLargeRequest")
	FuncEstimateMinStorageDeposit = coreutil.Func("estimateMinStorageDeposit")
	FuncInfiniteLoop              = coreutil.Func("infiniteLoop")
	FuncInfiniteLoopView          = coreutil.ViewFunc("infiniteLoopView")
	FuncSendNFTsBack              = coreutil.Func("sendNFTsBack")
	FuncClaimAllowance            = coreutil.Func("claimAllowance")
)
View Source
var Contract = coreutil.NewContract("testcore")
View Source
var Processor = Contract.Processor(initialize,
	FuncChainOwnerIDView.WithHandler(testChainOwnerIDView),
	FuncChainOwnerIDFull.WithHandler(testChainOwnerIDFull),

	FuncEventLogGenericData.WithHandler(testEventLogGenericData),
	FuncEventLogEventData.WithHandler(testEventLogEventData),
	FuncEventLogDeploy.WithHandler(testEventLogDeploy),
	FuncSandboxCall.WithHandler(testSandboxCall),

	FuncTestCustomError.WithHandler(testCustomError),
	FuncPanicFullEP.WithHandler(testPanicFullEP),
	FuncPanicViewEP.WithHandler(testPanicViewEP),
	FuncCallPanicFullEP.WithHandler(testCallPanicFullEP),
	FuncCallPanicViewEPFromFull.WithHandler(testCallPanicViewEPFromFull),
	FuncCallPanicViewEPFromView.WithHandler(testCallPanicViewEPFromView),

	FuncDoNothing.WithHandler(doNothing),

	FuncWithdrawFromChain.WithHandler(withdrawFromChain),
	FuncCallOnChain.WithHandler(callOnChain),
	FuncSetInt.WithHandler(setInt),
	FuncGetInt.WithHandler(getInt),
	FuncGetFibonacci.WithHandler(getFibonacci),
	FuncGetFibonacciIndirect.WithHandler(getFibonacciIndirect),
	FuncCalcFibonacciIndirectStoreValue.WithHandler(calcFibonacciIndirectStoreValue),
	FuncViewCalcFibonacciResult.WithHandler(viewFibResult),
	FuncIncCounter.WithHandler(incCounter),
	FuncGetCounter.WithHandler(getCounter),
	FuncRunRecursion.WithHandler(runRecursion),

	FuncPassTypesFull.WithHandler(passTypesFull),
	FuncPassTypesView.WithHandler(passTypesView),
	FuncCheckContextFromFullEP.WithHandler(testCheckContextFromFullEP),
	FuncCheckContextFromViewEP.WithHandler(testCheckContextFromViewEP),

	FuncJustView.WithHandler(testJustView),

	FuncSpawn.WithHandler(spawn),

	FuncSplitFunds.WithHandler(testSplitFunds),
	FuncSplitFundsNativeTokens.WithHandler(testSplitFundsNativeTokens),
	FuncPingAllowanceBack.WithHandler(pingAllowanceBack),
	FuncSendLargeRequest.WithHandler(sendLargeRequest),
	FuncEstimateMinStorageDeposit.WithHandler(testEstimateMinimumStorageDeposit),
	FuncInfiniteLoop.WithHandler(infiniteLoop),
	FuncInfiniteLoopView.WithHandler(infiniteLoopView),
	FuncSendNFTsBack.WithHandler(sendNFTsBack),
	FuncClaimAllowance.WithHandler(claimAllowance),
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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