Skip to content

Commit

Permalink
renamed BtcDustOffset as BtcNonceMarkOffset and created constant BTCW…
Browse files Browse the repository at this point in the history
…ithdrawalDustAmount
  • Loading branch information
ws4charlie committed Jun 6, 2024
1 parent 3f02526 commit d738330
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ var (
}
)

func BtcDustOffset() int64 {
// BtcNonceMarkOffset is the offset satoshi amount to calculate the nonce mark output
func BtcNonceMarkOffset() int64 {
return 2000
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/chains/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// A very special value to mark current nonce in UTXO
func NonceMarkAmount(nonce uint64) int64 {
// #nosec G701 always in range
return int64(nonce) + BtcDustOffset() // +2000 to avoid being a dust rejection
return int64(nonce) + BtcNonceMarkOffset()
}

// HashToString convert hash bytes to string
Expand Down
3 changes: 3 additions & 0 deletions pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ const (

// CmdMigrateTssFunds is used for CCTX of type cmd to give the instruction to the TSS to transfer its funds on a new address
CmdMigrateTssFunds = "cmd_migrate_tss_funds"

// BTCWithdrawalDustAmount is the minimum satoshis that can be withdrawn from zEVM to avoid outbound dust output
BTCWithdrawalDustAmount = 1000
)

0 comments on commit d738330

Please sign in to comment.