Skip to content

Commit

Permalink
chore: add windows icon and run make format swagger golines (#328)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 authored Feb 2, 2025
1 parent 594620e commit 1cb158f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
Binary file added .github/assets/adder.ico
Binary file not shown.
96 changes: 48 additions & 48 deletions filter/chainsync/chainsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,69 +19,69 @@ import "testing"
// MockLogger is a mock implementation of the plugin.Logger interface
type MockLogger struct{}

func (l *MockLogger) Info(msg string, args ...interface{}) {}
func (l *MockLogger) Error(msg string, args ...interface{}) {}
func (l *MockLogger) Debug(msg string, args ...interface{}) {}
func (l *MockLogger) Warn(msg string, args ...interface{}) {}
func (l *MockLogger) Trace(msg string, args ...interface{}) {}
func (l *MockLogger) Info(msg string, args ...interface{}) {}
func (l *MockLogger) Error(msg string, args ...interface{}) {}
func (l *MockLogger) Debug(msg string, args ...interface{}) {}
func (l *MockLogger) Warn(msg string, args ...interface{}) {}
func (l *MockLogger) Trace(msg string, args ...interface{}) {}

func TestNewChainSync(t *testing.T) {
c := New()
if c == nil {
t.Fatalf("expected non-nil ChainSync instance")
}
c := New()
if c == nil {
t.Fatalf("expected non-nil ChainSync instance")
}
}

func TestChainSync_Start(t *testing.T) {
c := New()
err := c.Start()
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
// Additional checks can be added here
c := New()
err := c.Start()
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
// Additional checks can be added here
}

func TestChainSync_Stop(t *testing.T) {
c := New()
err := c.Stop()
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
// Check if channels are closed
select {
case <-c.inputChan:
default:
t.Fatalf("expected inputChan to be closed")
}
select {
case <-c.outputChan:
default:
t.Fatalf("expected outputChan to be closed")
}
select {
case <-c.errorChan:
default:
t.Fatalf("expected errorChan to be closed")
}
c := New()
err := c.Stop()
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
// Check if channels are closed
select {
case <-c.inputChan:
default:
t.Fatalf("expected inputChan to be closed")
}
select {
case <-c.outputChan:
default:
t.Fatalf("expected outputChan to be closed")
}
select {
case <-c.errorChan:
default:
t.Fatalf("expected errorChan to be closed")
}
}

func TestChainSync_ErrorChan(t *testing.T) {
c := New()
if c.ErrorChan() == nil {
t.Fatalf("expected non-nil errorChan")
}
c := New()
if c.ErrorChan() == nil {
t.Fatalf("expected non-nil errorChan")
}
}

func TestChainSync_InputChan(t *testing.T) {
c := New()
if c.InputChan() == nil {
t.Fatalf("expected non-nil inputChan")
}
c := New()
if c.InputChan() == nil {
t.Fatalf("expected non-nil inputChan")
}
}

func TestChainSync_OutputChan(t *testing.T) {
c := New()
if c.OutputChan() == nil {
t.Fatalf("expected non-nil outputChan")
}
c := New()
if c.OutputChan() == nil {
t.Fatalf("expected non-nil outputChan")
}
}
2 changes: 1 addition & 1 deletion input/chainsync/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewTransactionEvent(
if len(resolvedInputs) > 0 {
evt.ResolvedInputs = resolvedInputs
}
if withdrawals := tx.Withdrawals(); len(withdrawals) > 0{
if withdrawals := tx.Withdrawals(); len(withdrawals) > 0 {
evt.Withdrawals = make(map[string]uint64)
for addr, amount := range withdrawals {
evt.Withdrawals[addr.String()] = amount
Expand Down

0 comments on commit 1cb158f

Please sign in to comment.