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

synapsecns / sanguine / 2817136931

08 Aug 2022 10:20AM UTC coverage: 62.823% (-2.2%) from 65.047%
2817136931

Pull #83

github

Trajan0x
new notary methods
Pull Request #83: Use new go method to retrieve attestations

640 of 640 new or added lines in 23 files covered. (100.0%)

1678 of 2671 relevant lines covered (62.82%)

0.67 hits per line

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

90.63
/core/types/tips.go
1
package types
2

3
import (
4
        "github.com/synapsecns/synapse-node/pkg/common"
5
        "math/big"
6
)
7

8
// Tips contain tips used for scientizing different agents.
9
type Tips interface {
10
        // Version gets the version of the tips header
11
        Version() uint16
12
        // UpdaterTip gets the tips for the updater
13
        UpdaterTip() *big.Int
14
        // RelayerTip gets the tips for the updater
15
        RelayerTip() *big.Int
16
        // ProverTip gets the tips for the prover
17
        ProverTip() *big.Int
18
        // ProcessorTip gets the tips for the processor
19
        ProcessorTip() *big.Int
20
}
21

22
// NewTips creates a new tips type.
23
func NewTips(updaterTip, relayerTip, proverTip, processorTip *big.Int) Tips {
1✔
24
        return tips{
1✔
25
                version:      tipsVersion,
1✔
26
                updaterTip:   updaterTip,
1✔
27
                relayerTip:   relayerTip,
1✔
28
                proverTip:    proverTip,
1✔
29
                processorTip: processorTip,
1✔
30
        }
1✔
31
}
1✔
32

33
// tips implements Tips.
34
type tips struct {
35
        version                                         uint16
36
        updaterTip, relayerTip, proverTip, processorTip *big.Int
37
}
38

39
func (t tips) Version() uint16 {
×
40
        return t.version
×
41
}
×
42

43
func (t tips) UpdaterTip() *big.Int {
1✔
44
        return common.CopyBigInt(t.updaterTip)
1✔
45
}
1✔
46

47
func (t tips) RelayerTip() *big.Int {
1✔
48
        return common.CopyBigInt(t.relayerTip)
1✔
49
}
1✔
50

51
func (t tips) ProverTip() *big.Int {
1✔
52
        return common.CopyBigInt(t.proverTip)
1✔
53
}
1✔
54

55
func (t tips) ProcessorTip() *big.Int {
1✔
56
        return common.CopyBigInt(t.processorTip)
1✔
57
}
1✔
58

59
var _ Tips = tips{}
60

61
// TotalTips gets the combined value of the tips.
62
func TotalTips(tips Tips) *big.Int {
1✔
63
        vals := []*big.Int{tips.UpdaterTip(), tips.ProcessorTip(), tips.RelayerTip(), tips.ProverTip()}
1✔
64
        total := new(big.Int)
1✔
65

1✔
66
        for _, val := range vals {
2✔
67
                total = new(big.Int).Add(total, val)
1✔
68
        }
1✔
69

70
        return total
1✔
71
}
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

© 2024 Coveralls, Inc