Documentation ¶
Index ¶
- Constants
- func Address(input interface{}) []byte
- func AddressArray(input interface{}) []byte
- func Bool(input interface{}) []byte
- func BoolArray(input interface{}) []byte
- func EthGenerateClaimMessage(event types.EthLogNewUnlockClaimEvent) []byte
- func EthGetAddressFromBridgeRegistry(privateKey *ecdsa.PrivateKey, client *ethclient.Client, ...) (common.Address, error)
- func EthInitRelayConfig(provider string, registry common.Address, event types.Event, ...) (*ethclient.Client, *bind.TransactOpts, common.Address)
- func HmyGenerateClaimMessage(event types.HmyLogNewUnlockClaimEvent) []byte
- func HmyGetAddressFromBridgeRegistry(privateKey *ecdsa.PrivateKey, client *hmyclient.Client, ...) (common.Address, error)
- func HmyInitRelayConfig(provider string, registry common.Address, event types.Event, ...) (*hmyclient.Client, *bind.TransactOpts, common.Address)
- func Int128(input interface{}) []byte
- func Int128Array(input interface{}) []byte
- func Int16(input interface{}) []byte
- func Int16Array(input interface{}) []byte
- func Int256(input interface{}) []byte
- func Int256Array(input interface{}) []byte
- func Int32(input interface{}) []byte
- func Int32Array(input interface{}) []byte
- func Int64(input interface{}) []byte
- func Int64Array(input interface{}) []byte
- func Int8(input interface{}) []byte
- func Int8Array(input interface{}) []byte
- func LoadEthereumPrivateKey() (key *ecdsa.PrivateKey, err error)
- func LoadHarmonyPrivateKey() (key *ecdsa.PrivateKey, err error)
- func LoadSender(privateKey *ecdsa.PrivateKey) (address common.Address, err error)
- func PrefixMsg(msg []byte) []byte
- func RelayOracleClaimToEthereum(provider string, contractAddress common.Address, event types.Event, ...) error
- func RelayOracleClaimToHarmony(provider string, contractAddress common.Address, event types.Event, ...) error
- func RelayUnlockClaimToEthereum(ethereumProvider string, ethereumBridgeRegistry common.Address, ...) error
- func RelayUnlockClaimToHarmony(harmonyProvider string, ethereumBridgeRegistry common.Address, ...) error
- func SignClaim(msg []byte, key *ecdsa.PrivateKey) ([]byte, error)
- func SoliditySHA3(data ...interface{}) []byte
- func String(input interface{}) []byte
- func StringArray(input interface{}) []byte
- func Uint128(input interface{}) []byte
- func Uint128Array(input interface{}) []byte
- func Uint16(input interface{}) []byte
- func Uint16Array(input interface{}) []byte
- func Uint256(input interface{}) []byte
- func Uint256Array(input interface{}) []byte
- func Uint32(input interface{}) []byte
- func Uint32Array(input interface{}) []byte
- func Uint64(input interface{}) []byte
- func Uint64Array(input interface{}) []byte
- func Uint8(input interface{}) []byte
- func Uint8Array(input interface{}) []byte
- type ContractRegistry
- type EthOracleClaim
- type EthUnlockClaim
- type HmyOracleClaim
- type HmyUnlockClaim
Constants ¶
const ( // GasLimit the gas limit in Gwei used for transactions sent with TransactOpts GasLimit = uint64(3000000) )
Variables ¶
This section is empty.
Functions ¶
func EthGenerateClaimMessage ¶
func EthGenerateClaimMessage(event types.EthLogNewUnlockClaimEvent) []byte
EthGenerateClaimMessage Generates a hashed message containing a UnlockClaim event's data
func EthGetAddressFromBridgeRegistry ¶
func EthGetAddressFromBridgeRegistry(privateKey *ecdsa.PrivateKey, client *ethclient.Client, registry common.Address, target ContractRegistry, ) (common.Address, error)
EthGetAddressFromBridgeRegistry queries the requested contract address from the BridgeRegistry contract
func EthInitRelayConfig ¶
func EthInitRelayConfig(provider string, registry common.Address, event types.Event, privateKey *ecdsa.PrivateKey, ) (*ethclient.Client, *bind.TransactOpts, common.Address)
EthInitRelayConfig set up Ethereum client, validator's transaction auth, and the target contract's address
func HmyGenerateClaimMessage ¶
func HmyGenerateClaimMessage(event types.HmyLogNewUnlockClaimEvent) []byte
HmyGenerateClaimMessage Generates a hashed message containing a UnlockClaim event's data
func HmyGetAddressFromBridgeRegistry ¶
func HmyGetAddressFromBridgeRegistry(privateKey *ecdsa.PrivateKey, client *hmyclient.Client, registry common.Address, target ContractRegistry, ) (common.Address, error)
HmyGetAddressFromBridgeRegistry queries the requested contract address from the BridgeRegistry contract
func HmyInitRelayConfig ¶
func HmyInitRelayConfig(provider string, registry common.Address, event types.Event, privateKey *ecdsa.PrivateKey, ) (*hmyclient.Client, *bind.TransactOpts, common.Address)
HmyInitRelayConfig set up Ethereum client, validator's transaction auth, and the target contract's address
func LoadEthereumPrivateKey ¶
func LoadEthereumPrivateKey() (key *ecdsa.PrivateKey, err error)
LoadEthereumPrivateKey loads the validator's private key from environment variables
func LoadHarmonyPrivateKey ¶
func LoadHarmonyPrivateKey() (key *ecdsa.PrivateKey, err error)
LoadHarmonyPrivateKey loads the validator's private key from environment variables
func LoadSender ¶
func LoadSender(privateKey *ecdsa.PrivateKey) (address common.Address, err error)
LoadSender uses the validator's private key to load the validator's address
func RelayOracleClaimToEthereum ¶
func RelayOracleClaimToEthereum(provider string, contractAddress common.Address, event types.Event, claim EthOracleClaim, privateKey *ecdsa.PrivateKey) error
RelayOracleClaimToEthereum relays the provided OracleClaim to Oracle contract on the Ethereum network
func RelayOracleClaimToHarmony ¶
func RelayOracleClaimToHarmony(provider string, contractAddress common.Address, event types.Event, claim HmyOracleClaim, privateKey *ecdsa.PrivateKey) error
RelayOracleClaimToHarmony relays the provided OracleClaim to Oracle contract on the Ethereum network
func RelayUnlockClaimToEthereum ¶
func RelayUnlockClaimToEthereum(ethereumProvider string, ethereumBridgeRegistry common.Address, event types.Event, claim EthUnlockClaim, privateKey *ecdsa.PrivateKey) error
RelayUnlockClaimToEthereum relays the provided UnlockClaim to HarmonyBridge contract on the Ethereum network
func RelayUnlockClaimToHarmony ¶
func RelayUnlockClaimToHarmony(harmonyProvider string, ethereumBridgeRegistry common.Address, event types.Event, claim HmyUnlockClaim, privateKey *ecdsa.PrivateKey) error
RelayUnlockClaimToHarmony relays the provided UnlockClaim to EthereumBridge contract on the Ethereum network
Types ¶
type ContractRegistry ¶
type ContractRegistry byte
ContractRegistry is an enum for the bridge contract types
const ( // Valset valset contract Valset ContractRegistry = iota + 1 // Oracle oracle contract Oracle // BridgeBank bridgeBank contract BridgeBank // HarmonyBridge contract HarmonyBridge // EthereumBridge contract EthereumBridge // BridgeRegistry contract BridgeRegistry )
func (ContractRegistry) String ¶
func (d ContractRegistry) String() string
String returns the event type as a string
type EthOracleClaim ¶
EthOracleClaim contains data required to make an EthOracleClaim
func EthUnlockClaimToSignedOracleClaim ¶
func EthUnlockClaimToSignedOracleClaim(event types.EthLogNewUnlockClaimEvent, key *ecdsa.PrivateKey) (EthOracleClaim, error)
EthUnlockClaimToSignedOracleClaim packages and signs a unlock claim's data, returning a new oracle claim
type EthUnlockClaim ¶
type EthUnlockClaim struct { HarmonyChainID *big.Int HarmonySender common.Address EthereumReceiver common.Address Token common.Address Amount *big.Int }
EthUnlockClaim contains data required to make an Ethereum UnlockClaim
func HarmonyEventToEthereumClaim ¶
func HarmonyEventToEthereumClaim(event *types.HmyLogLockEvent) (EthUnlockClaim, error)
HarmonyEventToEthereumClaim parses and packages an Ethereum event struct with a validator address in an EthBridgeClaim msg
type HmyOracleClaim ¶
HmyOracleClaim contains data required to make an HmyOracleClaim
func HmyUnlockClaimToSignedOracleClaim ¶
func HmyUnlockClaimToSignedOracleClaim(event types.HmyLogNewUnlockClaimEvent, key *ecdsa.PrivateKey) (HmyOracleClaim, error)
HmyUnlockClaimToSignedOracleClaim packages and signs a unlock claim's data, returning a new oracle claim
type HmyUnlockClaim ¶
type HmyUnlockClaim struct { EthereumChainID *big.Int EthereumSender common.Address HarmonyReceiver common.Address Token common.Address Amount *big.Int }
HmyUnlockClaim contains data required to make an Harmony UnlockClaim
func EthereumEventToHarmonyClaim ¶
func EthereumEventToHarmonyClaim(event *types.EthLogLockEvent) (HmyUnlockClaim, error)
EthereumEventToHarmonyClaim parses and packages an Ethereum event struct with a validator address in an EthBridgeClaim msg