Skip to content

Commit

Permalink
Merge pull request #176 from kcalvinalvin/2024-05-02-rename-tostring-…
Browse files Browse the repository at this point in the history
…to-string

blockchain, wire: rename ToString() to String()
  • Loading branch information
kcalvinalvin committed May 3, 2024
2 parents 743c4f6 + 107896f commit fca0a9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blockchain/utreexoviewpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ func (b *BlockChain) VerifyUData(ud *wire.UData, txIns []*wire.TxIn, remember bo
for i, txIn := range txIns {
leafHash := ud.LeafDatas[i].LeafHash()
str += fmt.Sprintf("txIn: %s, leafdata: %s, hash %s\n", txIn.PreviousOutPoint.String(),
ud.LeafDatas[i].ToString(), hex.EncodeToString(leafHash[:]))
ud.LeafDatas[i].String(), hex.EncodeToString(leafHash[:]))
}
str += fmt.Sprintf("err: %s", err.Error())
return fmt.Errorf(str)
Expand Down
4 changes: 2 additions & 2 deletions wire/leaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ func (l *LeafData) LeafHash() [32]byte {
return *(*[32]byte)(digest.Sum(nil))
}

// ToString turns a LeafData into a string for logging.
func (l *LeafData) ToString() (s string) {
// String turns a LeafData into a string for logging.
func (l *LeafData) String() (s string) {
s += fmt.Sprintf("BlockHash:%s,", hex.EncodeToString(l.BlockHash[:]))
s += fmt.Sprintf("OutPoint:%s,", l.OutPoint.String())
s += fmt.Sprintf("Amount:%d,", l.Amount)
Expand Down

0 comments on commit fca0a9d

Please sign in to comment.