From e4fac6e10649b7cb0581aa886df5a97bb0c3ecbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 17 Mar 2020 11:46:04 +0100 Subject: [PATCH] fix chats renamed to channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- cmd/x-check-mailserver/main.go | 8 +++++--- cmd/x-check-mailserver/work.go | 8 ++++---- go.mod | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/x-check-mailserver/main.go b/cmd/x-check-mailserver/main.go index 4181001..b2f0d62 100644 --- a/cmd/x-check-mailserver/main.go +++ b/cmd/x-check-mailserver/main.go @@ -51,9 +51,11 @@ func main() { // setup work workConfig := WorkUnitConfig{ - From: uint32(time.Now().Add(-*duration).Unix()), - To: uint32(time.Now().Add(-5 * time.Minute).Unix()), // subtract 5 mins to cater for TTL, time skew on devices etc. - Chats: *chats, + Channels: *channels, + // starting time for the envelope query + From: uint32(time.Now().Add(-*duration).Unix()), + // subtract 5 mins to cater for TTL, time skew on devices etc. + To: uint32(time.Now().Add(-5 * time.Minute).Unix()), } var ( diff --git a/cmd/x-check-mailserver/work.go b/cmd/x-check-mailserver/work.go index c721e94..97ea10e 100644 --- a/cmd/x-check-mailserver/work.go +++ b/cmd/x-check-mailserver/work.go @@ -43,9 +43,9 @@ func NewWorkUnit(mailEnode string, config *params.NodeConfig) *WorkUnit { // WorkUnitConfig configures the execution of the work. type WorkUnitConfig struct { - From uint32 - To uint32 - Chats []string + From uint32 + To uint32 + Channels []string } // Execute runs the work. @@ -62,7 +62,7 @@ func (u *WorkUnit) Execute(config WorkUnitConfig) error { return fmt.Errorf("failed to add peer: %v", err) } - for _, chatName := range config.Chats { + for _, chatName := range config.Channels { chat := protocol.CreatePublicChat(chatName, u.messenger.Timesource()) if err := u.messenger.Join(chat); err != nil { return err diff --git a/go.mod b/go.mod index 78d6e28..069c850 100644 --- a/go.mod +++ b/go.mod @@ -12,4 +12,5 @@ require ( github.com/ethereum/go-ethereum v1.9.5 github.com/spf13/pflag v1.0.3 github.com/status-im/status-go v0.48.2 + go.uber.org/zap v1.13.0 )