• 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

50.0
/w3vm/receipt.go
1
package w3vm
2

3
import (
4
        "errors"
5

6
        "github.com/ethereum/go-ethereum/common"
7
        "github.com/ethereum/go-ethereum/core/types"
8
        "github.com/lmittmann/w3/w3types"
9
)
10

11
var ErrMissingFunc = errors.New("missing function")
12

13
// Receipt represents the result of an applied [w3types.Message].
14
type Receipt struct {
15
        f w3types.Func // Func of corresponding message
16

17
        GasUsed         uint64          // Gas used for executing the message
18
        GasRefund       uint64          // Gas refunded after executing the message
19
        Logs            []*types.Log    // Logs emitted while executing the message
20
        Output          []byte          // Output of the executed message
21
        ContractAddress *common.Address // Address of the created contract, if any
22

23
        Err error // Execution error, if any
24
}
25

26
// DecodeReturns is like [w3types.Func.DecodeReturns], but returns [ErrMissingFunc]
27
// if the underlying [w3types.Message.Func] is nil.
28
func (r Receipt) DecodeReturns(returns ...any) error {
115✔
29
        if r.Err != nil {
115✔
30
                return r.Err
×
31
        }
×
32
        if r.f == nil {
115✔
33
                return ErrMissingFunc
×
34
        }
×
35
        return r.f.DecodeReturns(r.Output, returns...)
115✔
36
}
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