forked from multiversx/mx-chain-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dtos.go
78 lines (69 loc) · 2.5 KB
/
dtos.go
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package factory
import (
"math/big"
"github.com/ElrondNetwork/elrond-go/core"
"github.com/ElrondNetwork/elrond-go/crypto"
"github.com/ElrondNetwork/elrond-go/data"
"github.com/ElrondNetwork/elrond-go/data/state"
"github.com/ElrondNetwork/elrond-go/data/typeConverters"
"github.com/ElrondNetwork/elrond-go/dataRetriever"
"github.com/ElrondNetwork/elrond-go/hashing"
"github.com/ElrondNetwork/elrond-go/marshal"
"github.com/ElrondNetwork/elrond-go/p2p"
"github.com/ElrondNetwork/elrond-go/process"
"github.com/ElrondNetwork/elrond-go/vm"
)
// StateComponents struct holds the state components of the Elrond protocol
type StateComponents struct {
AddressPubkeyConverter state.PubkeyConverter
ValidatorPubkeyConverter state.PubkeyConverter
PeerAccounts state.AccountsAdapter
AccountsAdapter state.AccountsAdapter
InBalanceForShard map[string]*big.Int
}
// CoreComponents is the DTO used for core components
type CoreComponents struct {
Hasher hashing.Hasher
InternalMarshalizer marshal.Marshalizer
VmMarshalizer marshal.Marshalizer
TxSignMarshalizer marshal.Marshalizer
Uint64ByteSliceConverter typeConverters.Uint64ByteSliceConverter
StatusHandler core.AppStatusHandler
ChainID []byte
}
// CryptoParams is a DTO for holding block signing parameters
type CryptoParams struct {
KeyGenerator crypto.KeyGenerator
PrivateKey crypto.PrivateKey
PublicKey crypto.PublicKey
PublicKeyBytes []byte
PublicKeyString string
}
// DataComponents struct holds the data components
type DataComponents struct {
Blkc data.ChainHandler
Store dataRetriever.StorageService
Datapool dataRetriever.PoolsHolder
}
// TriesComponents holds the tries components
type TriesComponents struct {
TriesContainer state.TriesHolder
TrieStorageManagers map[string]data.StorageManager
}
// CryptoComponents struct holds the crypto components
type CryptoComponents struct {
TxSingleSigner crypto.SingleSigner
SingleSigner crypto.SingleSigner
MultiSigner crypto.MultiSigner
BlockSignKeyGen crypto.KeyGenerator
TxSignKeyGen crypto.KeyGenerator
InitialPubKeys map[uint32][]string
MessageSignVerifier vm.MessageSignVerifier
}
// NetworkComponents struct holds the network components
type NetworkComponents struct {
NetMessenger p2p.Messenger
InputAntifloodHandler P2PAntifloodHandler
OutputAntifloodHandler P2PAntifloodHandler
PeerBlackListHandler process.BlackListHandler
}