Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #2100

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ Changes in 0.8.0-beta (Sun May 25 2014)
recent reference client changes
(https://github.com/conformal/btcd/issues/100)
- Raise the maximum signature script size to support standard 15-of-15
multi-signature pay-to-sript-hash transactions with compressed pubkeys
multi-signature pay-to-script-hash transactions with compressed pubkeys
to remain compatible with the reference client
(https://github.com/conformal/btcd/issues/128)
- Reduce max bytes allowed for a standard nulldata transaction to 40 for
Expand Down
2 changes: 1 addition & 1 deletion addrmgr/addrmanager_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestAddrManagerV1ToV2(t *testing.T) {
addrMgr.loadPeers()
addrs := addrMgr.getAddresses()
if len(addrs) != len(expectedAddrs) {
t.Fatalf("expected to find %d adddresses, found %d",
t.Fatalf("expected to find %d addresses, found %d",
len(expectedAddrs), len(addrs))
}
for _, addr := range addrs {
Expand Down
8 changes: 4 additions & 4 deletions blockchain/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ func TestLocateInventory(t *testing.T) {
&test.hashStop)
}
if !reflect.DeepEqual(headers, test.headers) {
t.Errorf("%s: unxpected headers -- got %v, want %v",
t.Errorf("%s: unexpected headers -- got %v, want %v",
test.name, headers, test.headers)
continue
}
Expand All @@ -795,7 +795,7 @@ func TestLocateInventory(t *testing.T) {
hashes := chain.LocateBlocks(test.locator, &test.hashStop,
maxAllowed)
if !reflect.DeepEqual(hashes, test.hashes) {
t.Errorf("%s: unxpected hashes -- got %v, want %v",
t.Errorf("%s: unexpected hashes -- got %v, want %v",
test.name, hashes, test.hashes)
continue
}
Expand Down Expand Up @@ -888,7 +888,7 @@ func TestHeightToHashRange(t *testing.T) {
}

if !reflect.DeepEqual(hashes, test.hashes) {
t.Errorf("%s: unxpected hashes -- got %v, want %v",
t.Errorf("%s: unexpected hashes -- got %v, want %v",
test.name, hashes, test.hashes)
}
}
Expand Down Expand Up @@ -960,7 +960,7 @@ func TestIntervalBlockHashes(t *testing.T) {
}

if !reflect.DeepEqual(hashes, test.hashes) {
t.Errorf("%s: unxpected hashes -- got %v, want %v",
t.Errorf("%s: unexpected hashes -- got %v, want %v",
test.name, hashes, test.hashes)
}
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/chainio.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ type SpentTxOut struct {
// Amount is the amount of the output.
Amount int64

// PkScipt is the public key script for the output.
// PkScript is the public key script for the output.
PkScript []byte

// Height is the height of the block containing the creating tx.
Expand Down
2 changes: 1 addition & 1 deletion blockchain/chainio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func TestSpendJournalErrors(t *testing.T) {
}

// TestUtxoSerialization ensures serializing and deserializing unspent
// trasaction output entries works as expected.
// transaction output entries works as expected.
func TestUtxoSerialization(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion blockchain/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func (b *BlockChain) TstSetCoinbaseMaturity(maturity uint16) {
b.chainParams.CoinbaseMaturity = maturity
}

// newFakeChain returns a chain that is usable for syntetic tests. It is
// newFakeChain returns a chain that is usable for synthetic tests. It is
// important to note that this chain has no database associated with it, so
// it is not usable with all functions and the tests must take care when making
// use of it.
Expand Down
2 changes: 1 addition & 1 deletion blockchain/difficulty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestBigToCompact(t *testing.T) {
}

// TestCompactToBig ensures CompactToBig converts numbers using the compact
// representation to the expected big intergers.
// representation to the expected big integers.
func TestCompactToBig(t *testing.T) {
tests := []struct {
in uint32
Expand Down
2 changes: 1 addition & 1 deletion blockchain/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const (

// ErrUnexpectedDifficulty indicates specified bits do not align with
// the expected value either because it doesn't match the calculated
// valued based on difficulty regarted rules or it is out of the valid
// valued based on difficulty regarded rules or it is out of the valid
// range.
ErrUnexpectedDifficulty

Expand Down
4 changes: 2 additions & 2 deletions blockchain/fullblocktests/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) {
// ---------------------------------------------------------------------
// The comments below identify the structure of the chain being built.
//
// The values in parenthesis repesent which outputs are being spent.
// The values in parenthesis represent which outputs are being spent.
//
// For example, b1(0) indicates the first collected spendable output
// which, due to the code above to create the correct number of blocks,
Expand Down Expand Up @@ -1194,7 +1194,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) {
accepted()

// ---------------------------------------------------------------------
// Multisig[Verify]/ChecksigVerifiy signature operation count tests.
// Multisig[Verify]/ChecksigVerify signature operation count tests.
// ---------------------------------------------------------------------

// Create block with max signature operations as OP_CHECKMULTISIG.
Expand Down
6 changes: 3 additions & 3 deletions blockchain/indexers/addrindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const (
addrKeyTypeWitnessScriptHash = 3

// addrKeyTypeTaprootPubKey is the address type in an address key that
// represnts a pay-to-taproot address. We use this to denote addresses
// represents a pay-to-taproot address. We use this to denote addresses
// related to the segwit v1 that are encoded in the bech32m format.
addrKeyTypeTaprootPubKey = 4

Expand Down Expand Up @@ -158,7 +158,7 @@ func serializeAddrIndexEntry(blockID uint32, txLoc wire.TxLoc) []byte {

// deserializeAddrIndexEntry decodes the passed serialized byte slice into the
// provided region struct according to the format described in detail above and
// uses the passed block hash fetching function in order to conver the block ID
// uses the passed block hash fetching function in order to convert the block ID
// to the associated block hash.
func deserializeAddrIndexEntry(serialized []byte, region *database.BlockRegion,
fetchBlockHash fetchBlockHashFunc) error {
Expand Down Expand Up @@ -734,7 +734,7 @@ func (idx *AddrIndex) indexBlock(data writeIndexData, block *btcutil.Block,
idx.indexPkScript(data, pkScript, txIdx)

// With an input indexed, we'll advance the
// stxo coutner.
// stxo counter.
stxoIndex++
}
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func BuildMerkleTreeStore(transactions []*btcutil.Tx, witness bool) []*chainhash
merkles[offset] = &newHash

// The normal case sets the parent node to the double sha256
// of the concatentation of the left and right children.
// of the concatenation of the left and right children.
default:
newHash := HashMerkleBranches(merkles[i], merkles[i+1])
merkles[offset] = &newHash
Expand Down
2 changes: 1 addition & 1 deletion blockchain/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
)

// TestDeserializeUtxoEntryV0 ensures deserializing unspent trasaction output
// TestDeserializeUtxoEntryV0 ensures deserializing unspent transaction output
// entries from the legacy version 0 format works as expected.
func TestDeserializeUtxoEntryV0(t *testing.T) {
tests := []struct {
Expand Down
2 changes: 1 addition & 1 deletion blockchain/utxocache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func TestUtxoCacheFlush(t *testing.T) {
t.Fatalf("Unexpected nil entry found for %v", outpoint)
}
if !entry.isModified() {
t.Fatal("Entry should be marked mofified")
t.Fatal("Entry should be marked modified")
}
if !entry.isFresh() {
t.Fatal("Entry should be marked fresh")
Expand Down
4 changes: 2 additions & 2 deletions blockchain/utxoviewpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ type UtxoViewpoint struct {
}

// BestHash returns the hash of the best block in the chain the view currently
// respresents.
// represents.
func (view *UtxoViewpoint) BestHash() *chainhash.Hash {
return &view.bestHash
}

// SetBestHash sets the hash of the best block in the chain the view currently
// respresents.
// represents.
func (view *UtxoViewpoint) SetBestHash(hash *chainhash.Hash) {
view.bestHash = *hash
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ func (b *BlockChain) checkBlockContext(block *btcutil.Block, prevNode *blockNode
//
// This function MUST be called with the chain state lock held (for reads).
func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block, view *UtxoViewpoint) error {
// Fetch utxos for all of the transaction ouputs in this block.
// Fetch utxos for all of the transaction outputs in this block.
// Typically, there will not be any utxos for any of the outputs.
fetch := make([]wire.OutPoint, 0, len(block.Transactions()))
for _, tx := range block.Transactions() {
Expand Down
2 changes: 1 addition & 1 deletion btcec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Bitcoin (secp256k1 only for now). It is designed so that it may be used with the
standard crypto/ecdsa packages provided with go. A comprehensive suite of test
is provided to ensure proper functionality. Package btcec was originally based
on work from ThePiachu which is licensed under the same terms as Go, but it has
signficantly diverged since then. The btcsuite developers original is licensed
significantly diverged since then. The btcsuite developers original is licensed
under the liberal ISC license.

Although this package was primarily written for btcd, it has intentionally been
Expand Down
2 changes: 1 addition & 1 deletion btcec/ecdsa/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func parseSig(sigStr []byte, der bool) (*Signature, error) {
}

// ParseSignature parses a signature in BER format for the curve type `curve'
// into a Signature type, perfoming some basic sanity checks. If parsing
// into a Signature type, performing some basic sanity checks. If parsing
// according to the more strict DER format is needed, use ParseDERSignature.
func ParseSignature(sigStr []byte) (*Signature, error) {
return parseSig(sigStr, false)
Expand Down
2 changes: 1 addition & 1 deletion btcec/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ func TestFieldSquareRoot(t *testing.T) {
input := setHex(test.in).Normalize()
want := setHex(test.want).Normalize()

// Calculate the square root and enusre the validity flag matches the
// Calculate the square root and ensure the validity flag matches the
// expected value.
var result FieldVal
isValid := result.SquareRootVal(input)
Expand Down
2 changes: 1 addition & 1 deletion btcec/schnorr/musig2/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func (s *Session) PublicNonce() [PubNonceSize]byte {
}

// NumRegisteredNonces returns the total number of nonces that have been
// regsitered so far.
// registered so far.
func (s *Session) NumRegisteredNonces() int {
return len(s.pubNonces)
}
Expand Down
2 changes: 1 addition & 1 deletion btcec/schnorr/musig2/musig2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func TestMuSigMultiParty(t *testing.T) {
}

// TestMuSigEarlyNonce tests that for protocols where nonces need to be
// exchagned before all signers are known, the context API works as expected.
// exchanged before all signers are known, the context API works as expected.
func TestMuSigEarlyNonce(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion btcec/schnorr/musig2/nonces.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func defaultNonceGenOpts() *nonceGenOpts {

// WithCustomRand allows a caller to use a custom random number generator in
// place for crypto/rand. This should only really be used to generate
// determinstic tests.
// deterministic tests.
func WithCustomRand(r io.Reader) NonceGenOption {
return func(o *nonceGenOpts) {
o.randReader = r
Expand Down
4 changes: 2 additions & 2 deletions btcec/schnorr/musig2/sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ type sigCombineTestVectors struct {
ValidCases []sigCombineValidCase `json:"valid_test_cases"`
}

func pSigsFromIndicies(t *testing.T, sigs []string, indices []int) []*PartialSignature {
func pSigsFromIndices(t *testing.T, sigs []string, indices []int) []*PartialSignature {
pSigs := make([]*PartialSignature, len(indices))
for i, idx := range indices {
var pSig PartialSignature
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestMusig2SignCombine(t *testing.T) {
t, testCase.NonceIndices, testCases.PubNonces,
)

partialSigs := pSigsFromIndicies(
partialSigs := pSigsFromIndices(
t, testCases.Psigs, testCase.PSigIndices,
)

Expand Down
2 changes: 1 addition & 1 deletion btcjson/btcdextcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
// persistent peer.
NRemove NodeSubCmd = "remove"

// NDisconnect indicates the specified peer should be disonnected.
// NDisconnect indicates the specified peer should be disconnected.
NDisconnect NodeSubCmd = "disconnect"
)

Expand Down
2 changes: 1 addition & 1 deletion btcjson/btcdextresults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// TestBtcdExtCustomResults ensures any results that have custom marshalling
// work as inteded.
// work as intended.
// and unmarshal code of results are as expected.
func TestBtcdExtCustomResults(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion btcjson/chainsvrresults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// TestChainSvrCustomResults ensures any results that have custom marshalling
// work as inteded.
// work as intended.
// and unmarshal code of results are as expected.
func TestChainSvrCustomResults(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion btcjson/chainsvrwsresults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// TestChainSvrWsResults ensures any results that have custom marshalling
// work as inteded.
// work as intended.
func TestChainSvrWsResults(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion btcjson/cmdinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/btcsuite/btcd/btcjson"
)

// TestCmdMethod tests the CmdMethod function to ensure it retunrs the expected
// TestCmdMethod tests the CmdMethod function to ensure it returns the expected
// methods and errors.
func TestCmdMethod(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion btcjson/cmdparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func baseType(arg reflect.Type) (reflect.Type, int) {
// assignField is the main workhorse for the NewCmd function which handles
// assigning the provided source value to the destination field. It supports
// direct type assignments, indirection, conversion of numeric types, and
// unmarshaling of strings into arrays, slices, structs, and maps via
// unmarshalling of strings into arrays, slices, structs, and maps via
// json.Unmarshal.
func assignField(paramNum int, fieldName string, dest reflect.Value, src reflect.Value) error {
// Just error now when the types have no chance of being compatible.
Expand Down
2 changes: 1 addition & 1 deletion btcjson/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// embedded type which is not not supported.
ErrEmbeddedType

// ErrUnexportedField indiciates the provided command struct contains an
// ErrUnexportedField indicates the provided command struct contains an
// unexported field which is not supported.
ErrUnexportedField

Expand Down
2 changes: 1 addition & 1 deletion btcutil/bech32/bech32.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const charset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
var gen = []int{0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3}

// toBytes converts each character in the string 'chars' to the value of the
// index of the correspoding character in 'charset'.
// index of the corresponding character in 'charset'.
func toBytes(chars string) ([]byte, error) {
decoded := make([]byte, 0, len(chars))
for i := 0; i < len(chars); i++ {
Expand Down
4 changes: 2 additions & 2 deletions btcutil/bech32/bech32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ func TestMixedCaseEncode(t *testing.T) {
}
}

// TestCanDecodeUnlimtedBech32 tests whether decoding a large bech32 string works
// TestCanDecodeUnlimitedBech32 tests whether decoding a large bech32 string works
// when using the DecodeNoLimit version
func TestCanDecodeUnlimtedBech32(t *testing.T) {
func TestCanDecodeUnlimitedBech32(t *testing.T) {
input := "11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq5kx0yd"

// Sanity check that an input of this length errors on regular Decode()
Expand Down
2 changes: 1 addition & 1 deletion btcutil/bloom/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func ExampleNewFilter() {
filter := bloom.NewFilter(10, tweak, 0.0001, wire.BloomUpdateNone)

// Create a transaction hash and add it to the filter. This particular
// trasaction is the first transaction in block 310,000 of the main
// transaction is the first transaction in block 310,000 of the main
// bitcoin block chain.
txHashStr := "fd611c56ca0d378cdcd16244b45c2ba9588da3adac367c4ef43e808b280b8a45"
txHash, err := chainhash.NewHashFromStr(txHashStr)
Expand Down
2 changes: 1 addition & 1 deletion btcutil/coinset/coins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func TestSimpleCoin(t *testing.T) {
t.Error("Different value of coin pkScript than expected")
}
if testSimpleCoin.NumConfs() != 1 {
t.Error("Differet value of num confs than expected")
t.Error("Different value of num confs than expected")
}
if testSimpleCoin.ValueAge() != testSimpleCoinTxValueAge0 {
t.Error("Different value of coin value * age than expected")
Expand Down
4 changes: 2 additions & 2 deletions btcutil/gcs/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func RandomKey() ([gcs.KeySize]byte, error) {
}

// DeriveKey is a utility function that derives a key from a chainhash.Hash by
// truncating the bytes of the hash to the appopriate key size.
// truncating the bytes of the hash to the appropriate key size.
func DeriveKey(keyHash *chainhash.Hash) [gcs.KeySize]byte {
var key [gcs.KeySize]byte
copy(key[:], keyHash.CloneBytes())
Expand Down Expand Up @@ -207,7 +207,7 @@ func (b *GCSBuilder) Build() (*gcs.Filter, error) {
return nil, b.err
}

// We'll ensure that all the parmaters we need to actually build the
// We'll ensure that all the paramaters we need to actually build the
// filter properly are set.
if b.p == 0 {
return nil, fmt.Errorf("p value is not set, cannot build")
Expand Down
Loading
Loading