Skip to content

Commit

Permalink
Minor adjustments for max line length
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Oct 7, 2020
1 parent 5b6f65d commit 72d63b5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ linters:
- nolintlint
- gci
- goconst
- lll
disable:
- gocritic # use this for very opinionated linting
- gochecknoglobals
Expand Down Expand Up @@ -384,6 +385,7 @@ issues:
- dupl
- gosec
- maligned
- lll

# Exclude known linters from partially hard-vendored code,
# which is impossible to exclude via "nolint" comments.
Expand Down
5 changes: 4 additions & 1 deletion address.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ func GetAddressFromScript(script string) (string, error) {

// Extract the address from the pubkey hash
var address *bsvutil.LegacyAddressPubKeyHash
if address, err = bsvutil.NewLegacyAddressPubKeyHash(addresses[0].ScriptAddress(), &chaincfg.MainNetParams); err != nil {
if address, err = bsvutil.NewLegacyAddressPubKeyHash(
addresses[0].ScriptAddress(),
&chaincfg.MainNetParams,
); err != nil {
return "", err
}

Expand Down
8 changes: 5 additions & 3 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func TxFromHex(rawHex string) (*transaction.Transaction, error) {
// CreateTxWithChange will automatically create the change output and calculate fees
//
// Use this if you don't want to figure out fees/change for a tx
func CreateTxWithChange(utxos []*Utxo, payToAddresses []*PayToAddress, opReturns []OpReturnData, changeAddress string, standardRate, dataRate float64, wif string) (*transaction.Transaction, error) {
func CreateTxWithChange(utxos []*Utxo, payToAddresses []*PayToAddress, opReturns []OpReturnData,
changeAddress string, standardRate, dataRate float64, wif string) (*transaction.Transaction, error) {

// Missing utxo(s) or change address
if len(utxos) == 0 {
Expand Down Expand Up @@ -114,7 +115,8 @@ func CreateTxWithChange(utxos []*Utxo, payToAddresses []*PayToAddress, opReturns
//
// Get the raw hex version: tx.ToString()
// Get the tx id: tx.GetTxID()
func CreateTx(utxos []*Utxo, addresses []*PayToAddress, opReturns []OpReturnData, wif string) (*transaction.Transaction, error) {
func CreateTx(utxos []*Utxo, addresses []*PayToAddress,
opReturns []OpReturnData, wif string) (*transaction.Transaction, error) {

// Missing utxo(s)
if len(utxos) == 0 {
Expand Down Expand Up @@ -179,7 +181,7 @@ func CreateTx(utxos []*Utxo, addresses []*PayToAddress, opReturns []OpReturnData
//
// If tx is nil this will panic
// Rate(s) can be derived from MinerAPI (default is DefaultDataRate and DefaultStandardRate)
// Reference: https://github.com/bitcoin-sv-specs/brfc-misc/tree/master/feespec#calculating-tx-fee-with-different-feetypes
// Reference: https://tncpw.co/c215a75c
func CalculateFeeForTx(tx *transaction.Transaction, standardRate, dataRate float64) uint64 {

// Set the totals
Expand Down
3 changes: 2 additions & 1 deletion verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const (
hBSV string = "Bitcoin Signed Message:\n"
)

// VerifyMessage verifies a string and address against the provided signature and assumes Bitcoin Signed Message encoding
// VerifyMessage verifies a string and address against the provided
// signature and assumes Bitcoin Signed Message encoding
//
// Error will occur if verify fails or verification is not successful (no bool)
func VerifyMessage(address, signature, data string) error {
Expand Down

0 comments on commit 72d63b5

Please sign in to comment.