utils

package
v0.0.0-...-09f7846 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(x *big.Int, y *big.Int) *big.Int

func AddresBase582HexString

func AddresBase582HexString(addr string) string

func AddresHexString2Base58

func AddresHexString2Base58(addr string) string

func CmpTestRuslt

func CmpTestRuslt(expRsult, relRsult *big.Int) *big.Float

func CmpTestWingDisRuslt

func CmpTestWingDisRuslt(marketAll, total, user, relWing *big.Int) (*big.Float, *big.Int)

func Div

func Div(x *big.Int, y *big.Int) *big.Int

func Div2float

func Div2float(x *big.Int, y *big.Int) *big.Float

func ExpInterestAdd

func ExpInterestAdd(totalBorrow, delayBlockNum, borrowRatePerBlock *big.Int) *big.Int

func ExpTestRuslt

func ExpTestRuslt(wingSpeed, users, total *big.Int, start, end, percetage uint32) *big.Int

func GenerateAccounts

func GenerateAccounts(cfg *config.Config, admin *goSdk.Account, goSdk *goSdk.OntologySdk) []*goSdk.Account

func GetAccounts

func GetAccounts(cfg *config.Config) []*goSdk.Account

func GetAccounts2

func GetAccounts2(start, num int) []*goSdk.Account

func GetTestConfig

func GetTestConfig() (*config.Config, *goSdk.Account, *goSdk.OntologySdk)

func GetTimeByTxhash

func GetTimeByTxhash(sdk *ontSDK.OntologySdk, txHash string) uint32

func InvokeNativeTx

func InvokeNativeTx(sdk *ontSDK.OntologySdk, signConfig *ontSDK.Account, gasPrice, gasLimit uint64,
	contract common.Address, method string, params []interface{}) (txHash string, err error)

func InvokeNeoVMTx

func InvokeNeoVMTx(sdk *ontSDK.OntologySdk, signConfig *ontSDK.Account, gasPrice, gasLimit uint64,
	contract common.Address, method string, params []interface{}) (txHash string, err error)

func InvokePreTx

func InvokePreTx(sdk *ontSDK.OntologySdk, sign *ontSDK.Account, gasPrice, gasLimit uint64, contract common.Address, method string, params []interface{}) (*common2.ResultItem, error)

func InvokeTx

func InvokeTx(sdk *ontSDK.OntologySdk, sign *ontSDK.Account, gasPrice, gasLimit uint64, contract common.Address, method string, params []interface{}) (string, error)

func InvokeWasmVMTx2

func InvokeWasmVMTx2(sdk *ontSDK.OntologySdk, signConfig *ontSDK.Account, tx *types.MutableTransaction) (txHash string, err error)

func Mul

func Mul(x *big.Int, y *big.Int) *big.Int

func NeoVMPreExecuteBigInt

func NeoVMPreExecuteBigInt(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (*big.Int, error)

func NeovmPreExecuteString

func NeovmPreExecuteString(sdk *ontSDK.OntologySdk, contract common.Address, params []interface{}) (string, error)

func NewAccountByWif

func NewAccountByWif(Wif string) (*goSdk.Account, error)

func NewAccountToDb

func NewAccountToDb(wallet *goSdk.Wallet)

func PreExecuteAddrArray

func PreExecuteAddrArray(sdk *ontSDK.OntologySdk, contract common.Address, method string,
	params []interface{}) ([]common.Address, error)

func PreExecuteAddress

func PreExecuteAddress(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (common.Address, error)

func PreExecuteBigInt

func PreExecuteBigInt(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (*big.Int, error)

func PreExecuteBool

func PreExecuteBool(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (bool, error)

func PreExecuteByteArray

func PreExecuteByteArray(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) ([]byte, error)

func PreExecuteString

func PreExecuteString(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (string, error)

func PreExecuteStringArray

func PreExecuteStringArray(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) ([]string, error)

func PreExecuteU256

func PreExecuteU256(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (*big.Int, error)

func PreExecuteUint128

func PreExecuteUint128(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (common.I128, error)

func PreExecuteUint64

func PreExecuteUint64(sdk *ontSDK.OntologySdk, contract common.Address, method string, params []interface{}) (uint64, error)

func PrintSmartEventByHash_Ont

func PrintSmartEventByHash_Ont(sdk *goSdk.OntologySdk, txHash string)

func SignAndSendTx

func SignAndSendTx(sdk *goSdk.OntologySdk, tx *types.MutableTransaction, signer goSdk.Signer) (string, error)

func SignTx

func SignTx(sdk *goSdk.OntologySdk, tx *types.MutableTransaction, nonce uint32, signer goSdk.Signer) error

func SignTxAndSendTx

func SignTxAndSendTx(sdk *goSdk.OntologySdk, tx *types.MutableTransaction, nonce uint32, signer goSdk.Signer) error

func Sub

func Sub(x *big.Int, y *big.Int) *big.Int

func ToIntByPrecise

func ToIntByPrecise(str string, precise uint64) *big.Int

func ToStringByPrecise

func ToStringByPrecise(bigNum *big.Int, precise uint64) string

func Uint256FromhexString

func Uint256FromhexString(hex string) common.Uint256

func UpdateStakingBalance

func UpdateStakingBalance(wing_balance *big.Int, base58 string)

func UpdateWingBalance

func UpdateWingBalance(wing_balance *big.Int, base58 string)

Types

type ClaimWingAtMarket

type ClaimWingAtMarket struct {
	DistributedBorrowerWing  *big.Int
	DistributedSupplierWing  *big.Int
	DistributedGuaranteeWing *big.Int
	MarketAccruedSupply      []*big.Int
	MarketAccruedBorrow      []*big.Int

	Timestamp uint32
}

func GetClaimWingEventByHash

func GetClaimWingEventByHash(sdk *ontSDK.OntologySdk, txHash string) *ClaimWingAtMarket

type DistributeWing2FalsPool

type DistributeWing2FalsPool struct {
	DistributeWing        *big.Int
	MarketAccruedUpdateds map[string]*big.Int
}

func GetDistributeWing2IfMarketByHash

func GetDistributeWing2IfMarketByHash(sdk *ontSDK.OntologySdk, txHash string) *DistributeWing2FalsPool

func GetDistributeWing2PoolByHash

func GetDistributeWing2PoolByHash(sdk *ontSDK.OntologySdk, txHash string) *DistributeWing2FalsPool

type Token

type Token struct {
	TokenName       string
	TokenType       uint8
	ContractAddress common.Address
}

func NewToken

func NewToken(TokenName string,
	TokenType uint8,
	ContractAddress common.Address) Token

func (*Token) Serialize

func (token *Token) Serialize(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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