Documentation ¶
Overview ¶
Copyright 2018 Celer Network
Index ¶
- Constants
- Variables
- func AccountsCommand() *cobra.Command
- func AddCandidateWithStake(t *testing.T, transactor *transactor.Transactor, ethAddr mainchain.Addr, ...)
- func AddValidators(t *testing.T, transactor *transactor.Transactor, ethkss, sgnops []string, ...)
- func CheckCandidate(t *testing.T, transactor *transactor.Transactor, ethAddr mainchain.Addr, ...)
- func CheckDelegator(t *testing.T, transactor *transactor.Transactor, ...)
- func CheckValidator(t *testing.T, transactor *transactor.Transactor, sgnop string, expAmt *big.Int, ...)
- func CheckValidatorNum(t *testing.T, transactor *transactor.Transactor, expNum int)
- func CheckValidatorStatus(t *testing.T, transactor *transactor.Transactor, sgnop string, ...)
- func ChkErr(err error, msg string)
- func ChkTestErr(t *testing.T, err error, msg string)
- func DelegateStake(celrContract *mainchain.ERC20, guardAddr mainchain.Addr, ...) error
- func DeployCommand() *cobra.Command
- func DeployERC20Contract() (mainchain.Addr, *mainchain.ERC20)
- func DeployGuardContract(sgnParams *SGNParams) mainchain.Addr
- func DeployLedgerContract() mainchain.Addr
- func FundAddrsETH(amt string, recipients []mainchain.Addr) error
- func FundAddrsErc20(erc20Addr mainchain.Addr, addrs []mainchain.Addr, amount string) error
- func GetAddressFromKeystore(ksBytes []byte) (string, error)
- func GetAuth(ksfile string) (addr mainchain.Addr, auth *bind.TransactOpts, err error)
- func GetEthPrivateKey(ksfile string) (*ecdsa.PrivateKey, error)
- func InitializeCandidate(auth *bind.TransactOpts, sgnAddr sdk.AccAddress, minSelfStake *big.Int) error
- func IntendWithdraw(auth *bind.TransactOpts, candidateAddr mainchain.Addr, amt *big.Int) error
- func KillProcess(p *os.Process)
- func LogBlkNum(conn *ethclient.Client)
- func NewTransactor(t *testing.T, ...) *transactor.Transactor
- func OpenChannel(peer0, peer1 *mainchain.EthClient) (channelId [32]byte, err error)
- func ParseGatewayQueryResponse(resp *http.Response, cdc *codec.Codec) (json.RawMessage, error)
- func PrepareSignedSimplexState(seqNum uint64, channelId, peerFrom []byte, peer0, peer1 *mainchain.EthClient) (*chain.SignedSimplexState, error)
- func SetContracts(guardAddr, ledgerAddr mainchain.Addr) error
- func SetEthBaseKs(prefix string)
- func SetupE2eProfile()
- func SetupEthClients()
- func SleepBlocksWithLog(count time.Duration, waitFor string)
- func SleepWithLog(second time.Duration, waitFor string)
- func StartProcess(name string, args ...string) *os.Process
- func TearDown(tokill []Killable)
- func WaitMinedWithChk(ctx context.Context, conn *ethclient.Client, tx *ethtypes.Transaction, ...)
- type Killable
- type SGNParams
- type TestProfile
Constants ¶
View Source
const ( // outPathPrefix is the path prefix for all output from e2e (incl. chain data, binaries etc) // the code will append epoch second to this and create the folder // the folder will be deleted after test ends successfully OutRootDirPrefix = "/tmp/celer_e2e_" EnvDir = "../../env" LocalGeth = "http://127.0.0.1:8545" SgnChainID = "sgnchain" SgnPassphrase = "12341234" SgnGasPrice = "" SgnNodeURI = "tcp://localhost:26657" SgnCLIAddr = "cosmos1sev3nak38elq95lumnh6t2drjtfx73274vnnjh" SgnCLIHome = "../../../docker-volumes/node0/sgncli" SgnBlockInterval = 1 DefaultTimeout = 60 * time.Second BlockDelay = 1 DisputeTimeout = 100 )
Variables ¶
View Source
var ( SgnOperators = [...]string{"cosmos1ddvpnk98da5hgzz8lf5y82gnsrhvu3jd3cukpp", "cosmos1lh8cr9p2a9dxtunte0sn3qmjkyksdh5yc5yxph", "cosmos122w97t8vsa3538fr3ylvz3hvuqxrgpnax8es8f"} ValEthKs = [...]string{"../../keys/ethks0.json", "../../keys/ethks1.json", "../../keys/ethks2.json"} ValEthAddrs = [...]string{"6a6d2a97da1c453a4e099e8054865a0a59728863", "ba756d65a1a03f07d205749f35e2406e4a8522ad", "f25d8b54fad6e976eb9175659ae01481665a2254"} ClientEthKs = [...]string{"../../keys/ethks3.json", "../../keys/ethks4.json"} ClientEthAddrs = [...]string{"cb409caa43e385288d6bff2c3a0635688c7b3294", "75e912af38888643829380fa9f2c4019f5710ff5"} )
Functions ¶
func AccountsCommand ¶
func AddCandidateWithStake ¶
func AddCandidateWithStake(t *testing.T, transactor *transactor.Transactor, ethAddr mainchain.Addr, auth *bind.TransactOpts, sgnop string, amt *big.Int, minAmt *big.Int, isValidator bool)
func AddValidators ¶
func AddValidators(t *testing.T, transactor *transactor.Transactor, ethkss, sgnops []string, amts []*big.Int)
func CheckCandidate ¶
func CheckCandidate(t *testing.T, transactor *transactor.Transactor, ethAddr mainchain.Addr, sgnop string, expAmt *big.Int)
func CheckDelegator ¶
func CheckDelegator(t *testing.T, transactor *transactor.Transactor, validatorAddr, delegatorAddr mainchain.Addr, expAmt *big.Int)
func CheckValidator ¶
func CheckValidator(t *testing.T, transactor *transactor.Transactor, sgnop string, expAmt *big.Int, expStatus sdk.BondStatus)
func CheckValidatorNum ¶
func CheckValidatorNum(t *testing.T, transactor *transactor.Transactor, expNum int)
func CheckValidatorStatus ¶
func CheckValidatorStatus(t *testing.T, transactor *transactor.Transactor, sgnop string, expStatus sdk.BondStatus)
func DelegateStake ¶
func DeployCommand ¶
func DeployGuardContract ¶
func DeployLedgerContract ¶
func FundAddrsErc20 ¶
func GetAddressFromKeystore ¶
func GetEthPrivateKey ¶
func GetEthPrivateKey(ksfile string) (*ecdsa.PrivateKey, error)
func InitializeCandidate ¶
func InitializeCandidate(auth *bind.TransactOpts, sgnAddr sdk.AccAddress, minSelfStake *big.Int) error
func IntendWithdraw ¶
func KillProcess ¶
func NewTransactor ¶
func NewTransactor(t *testing.T, sgnCLIHome, sgnChainID, sgnNodeURI, sgnTransactor, sgnPassphrase, sgnGasPrice string) *transactor.Transactor
func OpenChannel ¶
func SetContracts ¶
func SetEthBaseKs ¶
func SetEthBaseKs(prefix string)
func SetupE2eProfile ¶
func SetupE2eProfile()
func SetupEthClients ¶
func SetupEthClients()
SetupEthClients sets Client part (Client) and Auth part (PrivateKey, Address, Auth) Contracts part (GuardAddress, Guard, LedgerAddress, Ledger) is set after deploying Guard contracts in setupNewSGNEnv()
func SleepBlocksWithLog ¶
func SleepWithLog ¶
func WaitMinedWithChk ¶
Types ¶
type TestProfile ¶
type TestProfile struct { DisputeTimeout uint64 LedgerAddr mainchain.Addr GuardAddr mainchain.Addr CelrAddr mainchain.Addr CelrContract *mainchain.ERC20 }
var ( // E2eProfile will be updated and used for each test // not support parallel tests E2eProfile *TestProfile )
runtime variables, will be initialized before each test
Click to show internal directories.
Click to hide internal directories.