Skip to content

Commit

Permalink
Fix: sapling state (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Apr 29, 2021
1 parent 913b302 commit a6bbafc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/bcd/ast/sapling_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import (
type SaplingState struct {
Default

Type Int
Type *Int
MemoSize int64
}

// NewSaplingState -
func NewSaplingState(depth int) *SaplingState {
return &SaplingState{
Default: NewDefault(consts.SAPLINGSTATE, 1, depth),
Type: NewInt(depth),
}
}

Expand Down Expand Up @@ -56,11 +57,7 @@ func (ss *SaplingState) ParseType(node *base.Node, id *int) error {
return err
}

if err := ss.Type.ParseType(node.Args[0], id); err != nil {
return err
}
ss.MemoSize = node.Args[0].IntValue.Int64()

return nil
}

Expand Down Expand Up @@ -118,7 +115,7 @@ func (ss *SaplingState) EqualType(node Node) bool {
return false
}

return ss.Type.EqualType(&second.Type)
return ss.Type.EqualType(second.Type)
}

// FindByName -
Expand Down

0 comments on commit a6bbafc

Please sign in to comment.