Skip to content

Commit

Permalink
Fix incorrect naming of stateless block (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Oct 10, 2024
1 parent 725a589 commit b8104ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions chain/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func NewGenesisBlock(root ids.ID) *StatelessBlock {
}
}

// Stateless is defined separately from "Block"
// StatefulBlock is defined separately from "StatelessBlock"
// in case external packages need to use the stateless block
// without mocking VM or parent block
type StatefulBlock struct {
Expand Down Expand Up @@ -200,7 +200,7 @@ func ParseBlock(
return nil, err
}
// Not guaranteed that a parsed block is verified
return ParseStatelessBlock(ctx, blk, source, accepted, vm)
return ParseStatefulBlock(ctx, blk, source, accepted, vm)
}

// populateTxs is only called on blocks we did not build
Expand Down Expand Up @@ -246,14 +246,14 @@ func (b *StatefulBlock) populateTxs(ctx context.Context) error {
return nil
}

func ParseStatelessBlock(
func ParseStatefulBlock(
ctx context.Context,
blk *StatelessBlock,
source []byte,
accepted bool,
vm VM,
) (*StatefulBlock, error) {
ctx, span := vm.Tracer().Start(ctx, "chain.ParseStatelessBlock")
ctx, span := vm.Tracer().Start(ctx, "chain.ParseStatefulBlock")
defer span.End()

// Perform basic correctness checks before doing any expensive work
Expand Down
2 changes: 1 addition & 1 deletion vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (vm *VM) Initialize(
snowCtx.Log.Info("genesis state created", zap.Stringer("root", root))

// Create genesis block
genesisBlk, err := chain.ParseStatelessBlock(
genesisBlk, err := chain.ParseStatefulBlock(
ctx,
chain.NewGenesisBlock(root),
nil,
Expand Down

0 comments on commit b8104ac

Please sign in to comment.