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

Commit

Permalink
Merge pull request #454 from BuxOrg/feat/306-remove-cmp
Browse files Browse the repository at this point in the history
feat(BUX-306): remove CMP references  from bux
  • Loading branch information
wregulski authored Nov 1, 2023
2 parents 3f12338 + d22014c commit 9229bcf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 625 deletions.
16 changes: 9 additions & 7 deletions model_bump.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/libsv/go-bt/v2"
)

const maxBumpHeight = 64

// BUMPPaths represents a slice of BUMPs (BSV Unified Merkle Paths)
type BUMPPaths []BUMP

Expand Down Expand Up @@ -41,9 +43,9 @@ func CalculateMergedBUMP(mp []MerkleProof) (BUMP, error) {
}

height := len(mp[0].Nodes)
if height > maxCmpHeight {
if height > maxBumpHeight {
return bump,
fmt.Errorf("BUMP cannot be higher than %d", maxCmpHeight)
fmt.Errorf("BUMP cannot be higher than %d", maxBumpHeight)
}

for _, m := range mp {
Expand Down Expand Up @@ -119,11 +121,6 @@ func (bump *BUMP) Hex() string {
return bump.bytesBuffer().String()
}

// In case the offset or height is less than 10, they must be written with a leading zero
func leadingZeroInt(i int) string {
return fmt.Sprintf("%02x", i)
}

func (bump *BUMP) bytesBuffer() *bytes.Buffer {
var buff bytes.Buffer
buff.WriteString(hex.EncodeToString(bt.VarInt(bump.BlockHeight).Bytes()))
Expand All @@ -146,6 +143,11 @@ func (bump *BUMP) bytesBuffer() *bytes.Buffer {
return &buff
}

// In case the offset or height is less than 10, they must be written with a leading zero
func leadingZeroInt(i int) string {
return fmt.Sprintf("%02x", i)
}

func flags(txID, duplicate bool) byte {
var (
dataFlag byte = 0o0
Expand Down
152 changes: 0 additions & 152 deletions model_compound_merkle_path.go

This file was deleted.

Loading

0 comments on commit 9229bcf

Please sign in to comment.