-
Notifications
You must be signed in to change notification settings - Fork 2
/
bodyfieldsetter.go
40 lines (33 loc) · 1.17 KB
/
bodyfieldsetter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package types
import (
"github.com/PositionExchange/posichain/block"
"github.com/PositionExchange/posichain/staking/types"
)
// BodyFieldSetter is a body field setter.
type BodyFieldSetter struct {
b *Body
}
// Transactions sets the Transactions field of the body.
func (bfs BodyFieldSetter) Transactions(newTransactions []*Transaction) BodyFieldSetter {
bfs.b.SetTransactions(newTransactions)
return bfs
}
// StakingTransactions sets the StakingTransactions field of the body.
func (bfs BodyFieldSetter) StakingTransactions(newStakingTransactions []*types.StakingTransaction) BodyFieldSetter {
bfs.b.SetStakingTransactions(newStakingTransactions)
return bfs
}
// Uncles sets the Uncles field of the body.
func (bfs BodyFieldSetter) Uncles(newUncles []*block.Header) BodyFieldSetter {
bfs.b.SetUncles(newUncles)
return bfs
}
// IncomingReceipts sets the IncomingReceipts field of the body.
func (bfs BodyFieldSetter) IncomingReceipts(newIncomingReceipts CXReceiptsProofs) BodyFieldSetter {
bfs.b.SetIncomingReceipts(newIncomingReceipts)
return bfs
}
// Body ends the field setter chain and returns the underlying body itself.
func (bfs BodyFieldSetter) Body() *Body {
return bfs.b
}