driver

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunDeployFlow

func RunDeployFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)

func RunEthToOrbsFlow

func RunEthToOrbsFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)

func RunOrbsToEthFlow

func RunOrbsToEthFlow(t *testing.T, config *Config, orbs OrbsAdapter, ethereum EthereumAdapter)

Types

type Config

type Config struct {
	DebugLogs                        bool
	EthereumErc20Address             string
	OrbsErc20ContractName            string
	OrbsAsbContractName              string
	UserAccountOnEthereum            string
	UserAccountOnOrbs                string
	UserInitialBalanceOnEthereum     int
	UserTransferAmountToOrbs         int
	UserTransferAmountBackToEthereum int
}

func (*Config) Validate

func (config *Config) Validate() error

type EthereumAdapter

type EthereumAdapter interface {
	DeployERC20Contract() (ethereumErc20Address string)
	DeployASBContract(ethereumErc20Address string, orbsAsbContractName string) (ethereumAsbAddress string)
	GetASBContractAddress() (ethereumAsbAddress string)
	FundUserAccount(ethereumErc20Address string, userAccountOnEthereum string, userInitialBalanceOnEthereum int) (userBalanceOnEthereumAfter int)
	TransferOut(ethereumErc20Address string, userAccountOnEthereum string, userAccountOnOrbs string, userTransferAmount int) (ethereumTxHash string, userBalanceOnEthereumAfter int)
	TransferIn(ethereumErc20Address string, userAccountOnEthereum string, packedOrbsReceiptProof string, packedOrbsReceipt string) (ethereumTxHash string, userBalanceOnEthereumAfter int)
	GetBalance(ethereumErc20Address string, userAccountOnEthereum string) (userBalanceOnEthereum int)
	WaitForFinality()
}

func AdapterForTruffleGanache

func AdapterForTruffleGanache(config *Config) EthereumAdapter

func AdapterForTruffleRopsten

func AdapterForTruffleRopsten(config *Config) EthereumAdapter

type OrbsAdapter

type OrbsAdapter interface {
	DeployERC20Contract(orbsErc20ContractName string, orbsAsbContractName string)
	DeployASBContract(orbsAsbContractName string, orbsErc20ContractName string)
	BindASBContractToEthereum(orbsAsbContractName string, ethereumAsbAddress string)
	OrbsUserIdToHexAddress(orbsUserId string) (userAccountOnOrbsHex string)
	TransferIn(orbsErc20ContractName string, orbsAsbContractName string, userAccountOnOrbs string, ethereumTxHash string) (userBalanceOnOrbsAfter int)
	TransferOut(orbsErc20ContractName string, orbsAsbContractName string, userAccountOnOrbs string, userAccountOnEthereum string, userTransferAmount int) (orbsTxId string, userBalanceOnOrbsAfter int)
	GetBalance(orbsErc20ContractName string, userAccountOnOrbs string) (userBalanceOnOrbs int)
	GenerateReceiptProof(orbsTxId string) (packedOrbsReceiptProof string, packedOrbsReceipt string)
}

func AdapterForGammaCliLocal

func AdapterForGammaCliLocal(config *Config) OrbsAdapter

func AdapterForGammaCliTestnet

func AdapterForGammaCliTestnet(config *Config) OrbsAdapter

Jump to

Keyboard shortcuts

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