-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmain.go
More file actions
57 lines (47 loc) · 1.07 KB
/
main.go
File metadata and controls
57 lines (47 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright 2021 ChainSafe Systems
// SPDX-License-Identifier: LGPL-3.0-only
package main
import (
"fmt"
celotx "github.com/ChainSafe/chainbridge-celo-module/transaction"
"github.com/ChainSafe/chainbridge-core/chains/evm"
"github.com/ChainSafe/chainbridge-core/chains/evm/evmtransaction"
"github.com/ChainSafe/chainbridge-core/chains/evm/voter"
"github.com/google/wire"
)
type Config struct {
blockstoreFlagName string
configFlagName string
}
func main() {
// This would be initialized from config/flags
cnfg := Config{
blockstoreFlagName: "",
configFlagName: "",
}
// Decide depending on flags
celloChain := CreateEVMCelloChain(
cnfg,
celotx.NewCeloTransaction,
)
evmChain := CreateEVMChain(
cnfg,
evmtransaction.NewTransaction,
)
fmt.Println(celloChain)
fmt.Println(evmChain)
}
func CreateEVMCelloChain(
cnfg Config,
txFabric voter.TxFabric,
) CeloEVMChain {
wire.Build(NewLvlDB, CeloSet)
return &evm.EVMChain{}
}
func CreateEVMChain(
cnfg Config,
txFabric voter.TxFabric,
) EVMChain {
wire.Build(NewLvlDB, EvmSet)
return &evm.EVMChain{}
}