Documentation ¶
Index ¶
- Constants
- Variables
- func IpToHexaBytes(ip string) string
- func NodeAdater(config *Config) *nodeAdapter
- func RunDeployFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
- func RunMirrorFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
- func RunProcessFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
- func RunReclaimGuardianDepositsFlow(t *testing.T, config *Config, ethereum EthereumAdapter)
- func RunRecordFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
- type Config
- type DelegateEvent
- type EthereumAdapter
- type GammaCliAdapter
- func (gamma *GammaCliAdapter) BindERC20ContractToEthereum(orbsVotingContractName string, ethereumErc20Address string)
- func (gamma *GammaCliAdapter) BindGuardiansContractToEthereum(orbsVotingContractName string, ethereumGuardiansAddress string)
- func (gamma *GammaCliAdapter) BindValidatorsContractToEthereum(orbsVotingContractName string, ethereumValidatorsAddress string)
- func (gamma *GammaCliAdapter) BindValidatorsRegistryContractToEthereum(orbsVotingContractName string, ethereumValidatorsRegistryAddress string)
- func (gamma *GammaCliAdapter) BindVotingContractToEthereum(orbsVotingContractName string, ethereumVotingAddress string)
- func (gamma *GammaCliAdapter) DeployContract(orbsVotingContractName string) string
- func (gamma *GammaCliAdapter) ForwardElectionResultsToSystem(electedValidatorAddresses []string)
- func (gamma *GammaCliAdapter) GetCurrentSystemBlockSigners() []string
- func (gamma *GammaCliAdapter) GetElectedNodes(orbsVotingContractName string) []string
- func (gamma *GammaCliAdapter) GetFinalityBlocksComponent() int
- func (gamma *GammaCliAdapter) GetFinalityTimeComponent() time.Duration
- func (gamma *GammaCliAdapter) GetMirrorVotingPeriod() int
- func (gamma *GammaCliAdapter) GetOrbsEnvironment() string
- func (gamma *GammaCliAdapter) SetContractConstants(orbsVotingContractName string)
- func (gamma *GammaCliAdapter) SetElectionBlockNumber(orbsVotingContractName string, blockHeight int)
- type NodeScriptAdapter
- type OrbsAdapter
- type TransferEvent
- type TruffleAdapter
- func (ta *TruffleAdapter) Delegate(ethereumVotingAddress string, from int, to int)
- func (ta *TruffleAdapter) DeployERC20Contract() (ethereumErc20Address string)
- func (ta *TruffleAdapter) DeployGuardiansContract() (ethereumGuardiansAddress string)
- func (ta *TruffleAdapter) DeployValidatorsContract() (ethereumValidatorsAddress string, ethereumValidatorsRegAddress string)
- func (ta *TruffleAdapter) DeployVotingContract() (ethereumVotingAddress string)
- func (ta *TruffleAdapter) GetConnectionUrl() string
- func (ta *TruffleAdapter) GetCurrentBlock() int
- func (ta *TruffleAdapter) GetStakes(ethereumErc20Address string, numberOfStakes int) map[int]float32
- func (ta *TruffleAdapter) GetStartOfHistoryBlock() int
- func (ta *TruffleAdapter) GetValidators(ethereumValidatorsAddress string, ethereumValidatorsRegAddress string) []validatorData
- func (ta *TruffleAdapter) PrintBalances()
- func (ta *TruffleAdapter) ResignGuardians(ethereumGuardiansAddress string, guardians []int)
- func (ta *TruffleAdapter) SetGuardians(ethereumGuardiansAddress string, guardians []int)
- func (ta *TruffleAdapter) SetStakes(ethereumErc20Address string, stakes []float32)
- func (ta *TruffleAdapter) SetValidators(ethereumValidatorsAddress string, ethereumValidatorsRegAddress string, ...)
- func (ta *TruffleAdapter) TopUpEther(accountIndexes []int)
- func (ta *TruffleAdapter) Transfer(ethereumErc20Address string, from int, to int, amount float32)
- func (ta *TruffleAdapter) Vote(ethereumVotingAddress string, activistIndex int, candidates []int)
- func (ta *TruffleAdapter) WaitForBlock(blockNumber int)
- func (ta *TruffleAdapter) WaitForFinality()
- type VoteEvent
Constants ¶
View Source
const DELEGATE_TRANSFER = float32(0.07)
Variables ¶
View Source
var DELEGATION_BY_TRANSFER_VALUE = big.NewInt(70000000000000000)
View Source
var ETHEREUM_STAKE_FACTOR = big.NewFloat(1000000000000000000)
Functions ¶
func IpToHexaBytes ¶
func NodeAdater ¶
func NodeAdater(config *Config) *nodeAdapter
func RunDeployFlow ¶
func RunDeployFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
func RunMirrorFlow ¶
func RunMirrorFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
func RunProcessFlow ¶
func RunProcessFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
func RunReclaimGuardianDepositsFlow ¶
func RunReclaimGuardianDepositsFlow(t *testing.T, config *Config, ethereum EthereumAdapter)
func RunRecordFlow ¶
func RunRecordFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)
Types ¶
type Config ¶
type Config struct { DebugLogs bool EthereumErc20Address string EthereumValidatorsAddress string EthereumValidatorsRegAddress string EthereumVotingAddress string EthereumGuardiansAddress string UserAccountOnOrbs string NumberOfAccounts int AccountStakeValues []float32 GuardiansAccounts []int ValidatorsAccounts []int ValidatorsOrbsAddresses []string ValidatorsOrbsIps []string SetupOverEthereumBlock int Transfers []*TransferEvent Delegates []*DelegateEvent Votes []*VoteEvent OrbsVotingContractName string FirstElectionBlockNumber int // zero to automatically determine after mirroring completes. positive value to enforce static value }
type DelegateEvent ¶
type EthereumAdapter ¶
type EthereumAdapter interface { GetStartOfHistoryBlock() int GetCurrentBlock() int DeployERC20Contract() (ethereumErc20Address string) GetStakes(ethereumErc20Address string, numberOfStakes int) (stakes map[int]float32) SetStakes(ethereumErc20Address string, stakes []float32) Transfer(ethereumErc20Address string, from int, to int, amount float32) TopUpEther(accountIndexes []int) PrintBalances() DeployValidatorsContract() (ethereumValidatorsAddress string, ethereumValidatorsRegAddress string) GetValidators(ethereumValidatorsAddress string, ethereumValidatorsRegAddress string) []validatorData SetValidators(ethereumValidatorsAddress string, ethereumValidatorsRegAddress string, validators []int, orbsAddresses []string, orbsIps []string) DeployVotingContract() (ethereumVotingAddress string) Delegate(ethereumVotingAddress string, from int, to int) Vote(ethereumVotingAddress string, activistInded int, to []int) DeployGuardiansContract() (ethereumGuardiansAddress string) SetGuardians(ethereumGuardiansAddress string, guardians []int) ResignGuardians(ethereumGuardiansAddress string, guardians []int) WaitForBlock(blockNumber int) GetConnectionUrl() string }
type GammaCliAdapter ¶
type GammaCliAdapter struct {
// contains filtered or unexported fields
}
func NewGammaCliAdapter ¶
func (*GammaCliAdapter) BindERC20ContractToEthereum ¶
func (gamma *GammaCliAdapter) BindERC20ContractToEthereum(orbsVotingContractName string, ethereumErc20Address string)
func (*GammaCliAdapter) BindGuardiansContractToEthereum ¶
func (gamma *GammaCliAdapter) BindGuardiansContractToEthereum(orbsVotingContractName string, ethereumGuardiansAddress string)
func (*GammaCliAdapter) BindValidatorsContractToEthereum ¶
func (gamma *GammaCliAdapter) BindValidatorsContractToEthereum(orbsVotingContractName string, ethereumValidatorsAddress string)
func (*GammaCliAdapter) BindValidatorsRegistryContractToEthereum ¶
func (gamma *GammaCliAdapter) BindValidatorsRegistryContractToEthereum(orbsVotingContractName string, ethereumValidatorsRegistryAddress string)
func (*GammaCliAdapter) BindVotingContractToEthereum ¶
func (gamma *GammaCliAdapter) BindVotingContractToEthereum(orbsVotingContractName string, ethereumVotingAddress string)
func (*GammaCliAdapter) DeployContract ¶
func (gamma *GammaCliAdapter) DeployContract(orbsVotingContractName string) string
func (*GammaCliAdapter) ForwardElectionResultsToSystem ¶
func (gamma *GammaCliAdapter) ForwardElectionResultsToSystem(electedValidatorAddresses []string)
func (*GammaCliAdapter) GetCurrentSystemBlockSigners ¶
func (gamma *GammaCliAdapter) GetCurrentSystemBlockSigners() []string
func (*GammaCliAdapter) GetElectedNodes ¶
func (gamma *GammaCliAdapter) GetElectedNodes(orbsVotingContractName string) []string
func (*GammaCliAdapter) GetFinalityBlocksComponent ¶
func (gamma *GammaCliAdapter) GetFinalityBlocksComponent() int
func (*GammaCliAdapter) GetFinalityTimeComponent ¶
func (gamma *GammaCliAdapter) GetFinalityTimeComponent() time.Duration
func (*GammaCliAdapter) GetMirrorVotingPeriod ¶
func (gamma *GammaCliAdapter) GetMirrorVotingPeriod() int
func (*GammaCliAdapter) GetOrbsEnvironment ¶
func (gamma *GammaCliAdapter) GetOrbsEnvironment() string
func (*GammaCliAdapter) SetContractConstants ¶
func (gamma *GammaCliAdapter) SetContractConstants(orbsVotingContractName string)
func (*GammaCliAdapter) SetElectionBlockNumber ¶
func (gamma *GammaCliAdapter) SetElectionBlockNumber(orbsVotingContractName string, blockHeight int)
type NodeScriptAdapter ¶
type OrbsAdapter ¶
type OrbsAdapter interface { DeployContract(orbsVotingContractName string) string SetContractConstants(orbsVotingContractName string) BindERC20ContractToEthereum(orbsVotingContractName string, ethereumErc20Address string) BindValidatorsContractToEthereum(orbsVotingContractName string, ethereumValidatorsAddress string) BindValidatorsRegistryContractToEthereum(orbsVotingContractName string, ethereumValidatorsRegistryAddress string) BindVotingContractToEthereum(orbsVotingContractName string, ethereumVotingAddress string) BindGuardiansContractToEthereum(orbsVotingContractName string, ethereumGuardiansAddress string) SetElectionBlockNumber(orbsVotingContractName string, blockHeight int) GetElectedNodes(orbsVotingContractName string) []string ForwardElectionResultsToSystem(electedValidatorAddresses []string) GetCurrentSystemBlockSigners() []string GetMirrorVotingPeriod() int GetOrbsEnvironment() string GetFinalityBlocksComponent() int GetFinalityTimeComponent() time.Duration }
type TransferEvent ¶
type TruffleAdapter ¶
type TruffleAdapter struct {
// contains filtered or unexported fields
}
func NewTruffleAdapter ¶
func (*TruffleAdapter) Delegate ¶
func (ta *TruffleAdapter) Delegate(ethereumVotingAddress string, from int, to int)
func (*TruffleAdapter) DeployERC20Contract ¶
func (ta *TruffleAdapter) DeployERC20Contract() (ethereumErc20Address string)
func (*TruffleAdapter) DeployGuardiansContract ¶
func (ta *TruffleAdapter) DeployGuardiansContract() (ethereumGuardiansAddress string)
func (*TruffleAdapter) DeployValidatorsContract ¶
func (ta *TruffleAdapter) DeployValidatorsContract() (ethereumValidatorsAddress string, ethereumValidatorsRegAddress string)
func (*TruffleAdapter) DeployVotingContract ¶
func (ta *TruffleAdapter) DeployVotingContract() (ethereumVotingAddress string)
func (*TruffleAdapter) GetConnectionUrl ¶
func (ta *TruffleAdapter) GetConnectionUrl() string
func (*TruffleAdapter) GetCurrentBlock ¶
func (ta *TruffleAdapter) GetCurrentBlock() int
func (*TruffleAdapter) GetStakes ¶
func (ta *TruffleAdapter) GetStakes(ethereumErc20Address string, numberOfStakes int) map[int]float32
func (*TruffleAdapter) GetStartOfHistoryBlock ¶
func (ta *TruffleAdapter) GetStartOfHistoryBlock() int
func (*TruffleAdapter) GetValidators ¶
func (ta *TruffleAdapter) GetValidators(ethereumValidatorsAddress string, ethereumValidatorsRegAddress string) []validatorData
func (*TruffleAdapter) PrintBalances ¶
func (ta *TruffleAdapter) PrintBalances()
func (*TruffleAdapter) ResignGuardians ¶
func (ta *TruffleAdapter) ResignGuardians(ethereumGuardiansAddress string, guardians []int)
func (*TruffleAdapter) SetGuardians ¶
func (ta *TruffleAdapter) SetGuardians(ethereumGuardiansAddress string, guardians []int)
func (*TruffleAdapter) SetStakes ¶
func (ta *TruffleAdapter) SetStakes(ethereumErc20Address string, stakes []float32)
func (*TruffleAdapter) SetValidators ¶
func (*TruffleAdapter) TopUpEther ¶
func (ta *TruffleAdapter) TopUpEther(accountIndexes []int)
func (*TruffleAdapter) Transfer ¶
func (ta *TruffleAdapter) Transfer(ethereumErc20Address string, from int, to int, amount float32)
func (*TruffleAdapter) Vote ¶
func (ta *TruffleAdapter) Vote(ethereumVotingAddress string, activistIndex int, candidates []int)
func (*TruffleAdapter) WaitForBlock ¶
func (ta *TruffleAdapter) WaitForBlock(blockNumber int)
func (*TruffleAdapter) WaitForFinality ¶
func (ta *TruffleAdapter) WaitForFinality()
Click to show internal directories.
Click to hide internal directories.