You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EVM client and Bitcoin client structs have common data fields which can be grouped into a BaseClient struct. BaseClient can then be reused by EVM client, Bitcoin client and future chain clients (e.g., DogeClient) by exposing unified methods.
The EVM signer and Bitcoin signer structs have common data fields which can be grouped into a BaseSigner struct. BaseSigner can then be reused by EVM client, Bitcoin client and future chain clients (e.g., DogeSigner) by exposing unified methods.
The commonly used loggers can also form a BaseClientLog struct and be reused by future chain clients.
Expected Outcome
// BaseClientLog is the base logger for external chain client
type BaseClientLog struct {
// Chain is the parent logger for the chain
Chain zerolog.Logger
// Inbound is the logger for incoming transactions
Inbound zerolog.Logger
// Outbound is the logger for outgoing transactions
Outbound zerolog.Logger
// GasPrice is the logger for gas prices
GasPrice zerolog.Logger
// Compliance is the logger for compliance checks
Compliance zerolog.Logger
}
// BaseClient is the base client struct for external chain client
type BaseClient struct {
// the external chain
chain chains.Chain
// the external chain's parameters
chainParams observertypes.ChainParams
// tss signer
tss interfaces.TSSSigner
// zetacore bridge
bridge interfaces.ZetaCoreBridger
// zetacore context
coreContext *corecontext.ZetaCoreContext
// the latest block height of external chain
lastBlock uint64
// the last successfully scanned block height
lastBlockScanned uint64
// lru cache for blocks
blockCache *lru.Cache
// client db for persistency
db *gorm.DB
// stop channel
stop chan struct{}
// telemetry server
ts *metrics.TelemetryServer
}
// BaseSigner is the base signer struct for external chain signer
type BaseSigner struct {
// the external chain
chain chains.Chain
tssSigner interfaces.TSSSigner
// the loggers
logger zerolog.Logger
loggerCompliance zerolog.Logger
// zetacore context
coreContext *corecontext.ZetaCoreContext
// telemetry server
ts *metrics.TelemetryServer
}
The text was updated successfully, but these errors were encountered:
ws4charlie
changed the title
refactor: create BaseClient and BaseSigner struct to group common data of EVM client/signer and Bitcoin client/signer
refactor: create base Observer and Signer struct to group common data of EVM observer/signer and Bitcoin observer/signer
Jun 4, 2024
Describe the Issue
BaseClient
struct.BaseClient
can then be reused by EVM client, Bitcoin client and future chain clients (e.g.,DogeClient
) by exposing unified methods.BaseSigner
struct.BaseSigner
can then be reused by EVM client, Bitcoin client and future chain clients (e.g.,DogeSigner
) by exposing unified methods.BaseClientLog
struct and be reused by future chain clients.Expected Outcome
The text was updated successfully, but these errors were encountered: