6
6
7
7
sdk "github.com/cosmos/cosmos-sdk/types"
8
8
"github.com/gogo/protobuf/proto"
9
- "github.com/palomachain/pigeon/attest"
10
9
"github.com/palomachain/pigeon/chain"
11
10
"github.com/palomachain/pigeon/chain/evm"
12
11
"github.com/palomachain/pigeon/chain/paloma"
28
27
29
28
_palomaClient * paloma.Client
30
29
31
- _evmClients map [string ]evm.Client
32
- _evmProcessors map [string ]chain.Processor
33
-
34
- _attestRegistry * attest.Registry
30
+ _evmFactory * evm.Factory
35
31
)
36
32
37
33
func Relayer () * relayer.Relayer {
@@ -40,8 +36,7 @@ func Relayer() *relayer.Relayer {
40
36
_relayer = relayer .New (
41
37
* Config (),
42
38
* PalomaClient (),
43
- AttestRegistry (),
44
- GetEvmProcessors (),
39
+ EvmFactory (),
45
40
)
46
41
}
47
42
return _relayer
@@ -63,35 +58,12 @@ func SetConfigPath(path string) {
63
58
_configPath = path
64
59
}
65
60
66
- func GetEvmProcessors () map [string ]chain.Processor {
67
- if _evmProcessors == nil {
68
- _evmProcessors = make (map [string ]chain.Processor )
69
- }
70
-
71
- for chainID , client := range GetEvmClients () {
72
- _evmProcessors [chainID ] = evm .NewProcessor (client , chainID )
61
+ func EvmFactory () * evm.Factory {
62
+ if _evmFactory == nil {
63
+ _evmFactory = evm .NewFactory (PalomaClient ())
73
64
}
74
65
75
- return _evmProcessors
76
- }
77
-
78
- func GetEvmClients () map [string ]evm.Client {
79
- if _evmClients == nil {
80
- _evmClients = make (map [string ]evm.Client )
81
- }
82
-
83
- config := Config ()
84
- for chainName , evmConfig := range config .EVM {
85
- if _ , ok := _evmClients [chainName ]; ok {
86
- log .WithFields (log.Fields {
87
- "chainName" : chainName ,
88
- }).Fatal ("chain with chainName already registered" )
89
- }
90
-
91
- _evmClients [chainName ] = evm .NewClient (evmConfig , PalomaClient (), chainName )
92
- }
93
-
94
- return _evmClients
66
+ return _evmFactory
95
67
}
96
68
97
69
func Config () * config.Root {
@@ -145,13 +117,6 @@ func PalomaClient() *paloma.Client {
145
117
return _palomaClient
146
118
}
147
119
148
- func AttestRegistry () * attest.Registry {
149
- if _attestRegistry == nil {
150
- _attestRegistry = attest .NewRegistry ()
151
- }
152
- return _attestRegistry
153
- }
154
-
155
120
func defaultValue [T comparable ](proposedVal T , defaultVal T ) T {
156
121
var zero T
157
122
if proposedVal == zero {
@@ -173,6 +138,8 @@ func palomaLensClientConfig(palomaConfig config.Paloma) *lens.ChainClientConfig
173
138
& consensustypes.MsgAddMessagesSignatures {},
174
139
& valsettypes.MsgAddExternalChainInfoForValidator {},
175
140
& consensustypes.MsgDeleteJob {},
141
+ & consensustypes.MsgAddEvidence {},
142
+ & consensustypes.MsgSetPublicAccessData {},
176
143
},
177
144
},
178
145
},
0 commit comments