From 72d63b57df9c04d109e107c3ec87ddf01a5f2936 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Wed, 7 Oct 2020 15:03:05 -0400 Subject: [PATCH] Minor adjustments for max line length --- .golangci.yml | 2 ++ address.go | 5 ++++- transaction.go | 8 +++++--- verify.go | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c0e8c11..a637738 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -349,6 +349,7 @@ linters: - nolintlint - gci - goconst + - lll disable: - gocritic # use this for very opinionated linting - gochecknoglobals @@ -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. diff --git a/address.go b/address.go index a05e153..e41d629 100644 --- a/address.go +++ b/address.go @@ -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 } diff --git a/transaction.go b/transaction.go index 2e09485..1ca7f94 100644 --- a/transaction.go +++ b/transaction.go @@ -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 { @@ -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 { @@ -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 diff --git a/verify.go b/verify.go index f145c91..4cbee78 100644 --- a/verify.go +++ b/verify.go @@ -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 {