test

package
v0.0.0-...-24e5678 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: LGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AmountNotNegative = "Amount can't be negative"

	ErrInvalidType   = errors.New("invalid Type")
	ErrFileRead      = errors.New("File Read Error")
	ErrNotFoundEvent = errors.New("Event Not Found")
	ErrArgument      = errors.New("Argument Error")
)
View Source
var (
	Zero       = big.NewInt(0)
	AmountZero = amount.NewAmount(0, 0)
	MaxUint256 = ToAmount(Sub(Exp(big.NewInt(2), big.NewInt(256)), big.NewInt(1)))

	AddressZero = common.Address{}

	ClassMap = map[string]uint64{}
)

Functions

func Abs

func Abs(a *big.Int) *big.Int

func Add

func Add(a, b *big.Int) *big.Int

func AddC

func AddC(a *big.Int, b int64) *big.Int

func Approx

func Approx(a, b, _precision float64) bool

func Clone

func Clone(a *big.Int) *big.Int

func CloneAmountSlice

func CloneAmountSlice(input []*amount.Amount) []*amount.Amount

func CloneSlice

func CloneSlice(input []*big.Int) []*big.Int

func CubicFunc

func CubicFunc(a, b, c, d, x float64) float64

func CubicRoot

func CubicRoot(a, b, c, d float64) (float64, error)

3차방정식 일반해 :

func Div

func Div(a, b *big.Int) *big.Int

func DivC

func DivC(a *big.Int, b int64) *big.Int

func Erc20TokenContractCreationTx

func Erc20TokenContractCreationTx(tb *testBlockChain, senderKey key.Key, initialSupply *amount.Amount) (*types.Transaction, error)

Erc20TokenContractCreation deploy Erc20Token contract with initialSupply(= 1 ether) source code : evm-client/contracts/ERC20Token.sol

func Exp

func Exp(a, b *big.Int) *big.Int

func IsPlus

func IsPlus(a *big.Int) bool

func MakeAmountSlice

func MakeAmountSlice(size uint8) []*amount.Amount

func MakeSlice

func MakeSlice(size uint8) []*big.Int

func MaxInArray

func MaxInArray(a []*big.Int) (int, *big.Int)

func Min

func Min(a, b *big.Int) *big.Int

func MinInArray

func MinInArray(a []*big.Int) (int, *big.Int)

func Mul

func Mul(a, b *big.Int) *big.Int

func MulC

func MulC(a *big.Int, b int64) *big.Int

func MulDiv

func MulDiv(a, b, denominator *big.Int) *big.Int

func MulDivC

func MulDivC(a, b *big.Int, denominator int64) *big.Int

func MulDivCC

func MulDivCC(a *big.Int, b, denominator int64) *big.Int

func MulF

func MulF(a *big.Int, b float64) (*big.Int, error)

func NewTestBlockChain

func NewTestBlockChain(path string, deletePath bool, chainID *big.Int, version uint16, genesis *types.Context, admin *common.Address, cfg *initContextInfo) (*testBlockChain, error)

NewTestBlockChain makes new test blockchain

func Newtonian

func Newtonian(a, b, c, d, x0 float64) (float64, error)

3차방정식 해 - Newtonian Method x0 initial

func Pow10

func Pow10(a int) *big.Int

func RegisterContracts

func RegisterContracts()

RegisterContracts creates classmap for deploying contracts ususally in genesis

func Sqrt

func Sqrt(a *big.Int) *big.Int

func Sub

func Sub(a, b *big.Int) *big.Int

func SubC

func SubC(a *big.Int, b int64) *big.Int

func Sum

func Sum(a []*big.Int) *big.Int

func ToAmount

func ToAmount(b *big.Int) *amount.Amount

func ToAmounts

func ToAmounts(b []*big.Int) []*amount.Amount

func ToBigInt

func ToBigInt(a float64) (*big.Int, error)

func ToBigInts

func ToBigInts(b []*amount.Amount) []*big.Int

func ToFloat64

func ToFloat64(a *big.Int) float64

max uint256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935 ~ 1.1e+77 max float64 = 1.7976931348623157e+308 max float32 = 3.4028234663852886e+38

Types

type Curve

type Curve struct {
	A int64
	// contains filtered or unexported fields
}

func (*Curve) D

func (self *Curve) D() *big.Int

D invariant calculation in non-overflowing integer operations iteratively

A * Sum(x_i) * n**n + D = A * D * n**n + D**(n+1) / (n**n * prod(x_i))

Converging solution: D[j+1] = (A * n**n * Sum(x_i) - D[j]**(n+1) / (n**n prod(x_i))) / (A * n**n - 1)

Jump to

Keyboard shortcuts

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