• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lmittmann / w3 / 12712430872

10 Jan 2025 03:13PM UTC coverage: 64.258% (-0.04%) from 64.3%
12712430872

Pull #207

github

lmittmann
fix
Pull Request #207: w3vm: fix tx coinbase tip

1 of 1 new or added line in 1 file covered. (100.0%)

16 existing lines in 1 file now uncovered.

1992 of 3100 relevant lines covered (64.26%)

810.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/module/eth/subscribe.go
1
package eth
2

3
import (
4
        "github.com/ethereum/go-ethereum"
5
        "github.com/ethereum/go-ethereum/core/types"
6
        "github.com/lmittmann/w3/w3types"
7
)
8

9
// NewHeads subscribes to notifications of updates to the blockchain head.
10
func NewHeads(ch chan<- *types.Header) w3types.RPCSubscriber {
×
11
        return &ethSubscription[*types.Header]{ch, []any{"newHeads"}, nil}
×
12
}
×
13

14
// PendingTransactions subscribes to notifications about new pending transactions in the transaction pool.
15
func PendingTransactions(ch chan<- *types.Transaction) w3types.RPCSubscriber {
×
16
        return &ethSubscription[*types.Transaction]{ch, []any{"newPendingTransactions", true}, nil}
×
17
}
×
18

19
// NewLogs subscribes to notifications about logs that match the given filter query.
20
func NewLogs(ch chan<- *types.Log, q ethereum.FilterQuery) w3types.RPCSubscriber {
×
21
        arg, err := toFilterArg(q)
×
22
        return &ethSubscription[*types.Log]{ch, []any{"logs", arg}, err}
×
23
}
×
24

25
type ethSubscription[T any] struct {
26
        ch     chan<- T
27
        params []any
28
        err    error
29
}
30

31
func (s *ethSubscription[T]) CreateRequest() (string, any, []any, error) {
×
32
        return "eth", s.ch, s.params, s.err
×
33
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc