File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,18 @@ type BanffProposalBlock struct {
28
28
ApricotProposalBlock `serialize:"true"`
29
29
}
30
30
31
+ func (b * BanffProposalBlock ) initialize (bytes []byte ) error {
32
+ if err := b .ApricotProposalBlock .initialize (bytes ); err != nil {
33
+ return err
34
+ }
35
+ for _ , tx := range b .Transactions {
36
+ if err := tx .Initialize (txs .Codec ); err != nil {
37
+ return fmt .Errorf ("failed to initialize tx: %w" , err )
38
+ }
39
+ }
40
+ return nil
41
+ }
42
+
31
43
func (b * BanffProposalBlock ) InitCtx (ctx * snow.Context ) {
32
44
for _ , tx := range b .Transactions {
33
45
tx .Unsigned .InitCtx (ctx )
@@ -39,6 +51,14 @@ func (b *BanffProposalBlock) Timestamp() time.Time {
39
51
return time .Unix (int64 (b .Time ), 0 )
40
52
}
41
53
54
+ func (b * BanffProposalBlock ) Txs () []* txs.Tx {
55
+ l := len (b .Transactions )
56
+ txs := make ([]* txs.Tx , l + 1 )
57
+ copy (txs , b .Transactions )
58
+ txs [l ] = b .Tx
59
+ return txs
60
+ }
61
+
42
62
func (b * BanffProposalBlock ) Visit (v Visitor ) error {
43
63
return v .BanffProposalBlock (b )
44
64
}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ func (b *ApricotStandardBlock) initialize(bytes []byte) error {
58
58
b .CommonBlock .initialize (bytes )
59
59
for _ , tx := range b .Transactions {
60
60
if err := tx .Initialize (txs .Codec ); err != nil {
61
- return fmt .Errorf ("failed to sign block : %w" , err )
61
+ return fmt .Errorf ("failed to initialize tx : %w" , err )
62
62
}
63
63
}
64
64
return nil
You can’t perform that action at this time.
0 commit comments