Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #24 from consensus-shipyard/valstring
Browse files Browse the repository at this point in the history
Fix validator types
  • Loading branch information
dnkolegov authored Aug 1, 2023
2 parents 64aa908 + ce6bec5 commit 49fa8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.idea
.DS_Store
7 changes: 1 addition & 6 deletions validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ type Validator struct {
Weight *abi.TokenAmount `json:"weight,omitempty"`
}

func NewValidator(a addr.Address, netAddr string) *Validator {
w := abi.NewTokenAmount(0)
return &Validator{Addr: a, NetAddr: netAddr, Weight: &w}
}

func NewValidatorWithWeight(a addr.Address, netAddr string, w *big.Int) *Validator {
return &Validator{Addr: a, NetAddr: netAddr, Weight: w}
}
Expand All @@ -97,7 +92,7 @@ func (v *Validator) Bytes() ([]byte, error) {
}

func (v *Validator) String() string {
return fmt.Sprintf("%s@%s", v.Addr.String(), v.NetAddr)
return fmt.Sprintf("%s@%s:%s", v.Addr.String(), v.NetAddr, v.Weight)
}

func SplitAndTrimEmpty(s, sep, cutset string) []string {
Expand Down

0 comments on commit 49fa8a0

Please sign in to comment.