Commit 8bdb3008 authored by Luke Champine's avatar Luke Champine

correct spelling mistakes

parent ac29c382
......@@ -177,7 +177,7 @@ v0.4.7 (patch)
- Dropped support for v0.3.3.x
v0.4.6 (patch)
- Removed over-agressive consistency check
- Removed over-aggressive consistency check
v0.4.5 (patch)
- Fixed last prominent bug in block database
......
......@@ -225,7 +225,7 @@ func (srv *Server) buildTransactionSet(txids []types.TransactionID) (txns []Expl
// payouts, the block might be the transaction.
block, height, exists := srv.explorer.Transaction(txid)
if !exists && build.DEBUG {
panic("explorer pointing to nonexistant txn")
panic("explorer pointing to nonexistent txn")
}
// Check if the block is the transaction.
......
......@@ -164,7 +164,7 @@ func assembleExplorerServerTester(testdir string) (*serverTester, error) {
}
// createServerTester creates a server tester object that is ready for testing,
// including money in the wallet and all modules initalized.
// including money in the wallet and all modules initialized.
func createServerTester(name string) (*serverTester, error) {
// Create the testing directory.
testdir := build.TempDir("api", name)
......@@ -189,7 +189,7 @@ func createServerTester(name string) (*serverTester, error) {
return st, nil
}
// createExplorerServerTester creates a server tester object contianing only
// createExplorerServerTester creates a server tester object containing only
// the explorer and some presets that match standard explorer setups.
func createExplorerServerTester(name string) (*serverTester, error) {
testdir := build.TempDir("api", name)
......
......@@ -157,7 +157,7 @@ func TestIntegrationWalletGETSiacoins(t *testing.T) {
}
defer st.server.Close()
// Check the intial wallet is encrypted, unlocked, and has the siacoins
// Check the initial wallet is encrypted, unlocked, and has the siacoins
// that got mined.
var wg WalletGET
err = st.getAPI("/wallet", &wg)
......
......@@ -16,7 +16,7 @@ func TestTreeBuilder(t *testing.T) {
// function is really for code coverage.
}
// TestCalculateLeaves probes the CalulateLeaves function.
// TestCalculateLeaves probes the CalculateLeaves function.
func TestCalculateLeaves(t *testing.T) {
tests := []struct {
size, expSegs uint64
......
......@@ -259,7 +259,7 @@ output spendable by the 'missed proof spend hash'.
All contracts must have a non-zero payout, 'start' must be before 'end', and
'start' must be greater than the current height of the blockchain. A storage
proof is acceptible if it is submitted in the block of height 'end'.
proof is acceptable if it is submitted in the block of height 'end'.
File contracts are created with a 'Revision Hash', which is the Merkle root of
an unlock conditions object. A 'file contract revision' can be submitted which
......
......@@ -15,7 +15,7 @@ Unmarshal([]byte{3, 0, 0, 0, 0, 0, 0, 0}, &x)
```
Note that this leads to some ambiguity. Since an `int64` and a `uint64` are
both 8 bytes long, it is possible to encode an `int64` and succesfully decode
both 8 bytes long, it is possible to encode an `int64` and successfully decode
it as a `uint64`. As a result, it is imperative that *the decoder knows
exactly what it is decoding*. Developers must rely on context to determine
what type to decode into.
......
......@@ -12,7 +12,7 @@ untrusted environment. Managing data on Sia happens through several protocols:
performed to verify that the renter is able to create the signatures to
modify the file contract revision.
+ File Contract Creation - no data is uploaded during the inital creation of a
+ File Contract Creation - no data is uploaded during the initial creation of a
file contract, but funds are allocated so that the file contract can be
iteratively revised in the future.
......@@ -68,7 +68,7 @@ Revision Request
----------------
The renter requests a recent revision from the host. Often, this request
preceeds modifications. A file contract can only be open for revision with one
precedes modifications. A file contract can only be open for revision with one
party at a time. To prevent DoS attacks, the party must authenticate here by
performing a challenge-response protocol during the revision request. Putting
this challenge-response requirement in the revision-request can help improve
......@@ -76,7 +76,7 @@ privacy, though the host is under no cryptographic or incentive-based
obligation to preserve the privacy of the revision.
1. The renter makes an RPC to the host, opening a connection. The connection
deadline sould be at least 120 seconds. The renter sends the file contract
deadline should be at least 120 seconds. The renter sends the file contract
id for the revision being requested.
2. The host writes 32 bytes of random data that the renter must sign for the
......
......@@ -70,7 +70,7 @@ type (
ProcessConsensusChange(ConsensusChange)
}
// A ConsensusChange enumerates a set of changes that occured to the consensus set.
// A ConsensusChange enumerates a set of changes that occurred to the consensus set.
ConsensusChange struct {
// ID is a unique id for the consensus change derived from the reverted
// and applied blocks.
......@@ -181,7 +181,7 @@ type (
Close() error
// ConsensusSetSubscribe adds a subscriber to the list of subscribers,
// and gives them every consensus change that has occured since the
// and gives them every consensus change that has occurred since the
// change with the provided id. There are a few special cases,
// described by the ConsensusChangeX variables in this package.
ConsensusSetSubscribe(ConsensusSetSubscriber, ConsensusChangeID) error
......
......@@ -149,7 +149,7 @@ func (cs *ConsensusSet) addBlockToTree(b types.Block) (ce changeEntry, err error
// modules.ErrNonExtendingBlock should be returned if the block does
// not extend the current blockchain, however the changes from newChild
// should be comitted (which means 'nil' must be returned). A flag is
// should be committed (which means 'nil' must be returned). A flag is
// set to indicate that modules.ErrNonExtending should be returned.
nonExtending = !newNode.heavierThan(currentNode)
if nonExtending {
......
......@@ -1004,7 +1004,7 @@ func (cst *consensusSetTester) testPaymentChannelBlocks() error {
}
refundTxn.TransactionSignatures[0].Signature = cryptoSig1[:]
// Recieving entity never communitcates, funding entity must reclaim
// Receiving entity never communitcates, funding entity must reclaim
// the 'channelSize' coins that were intended to go to the channel.
reclaimUC, err := cst.wallet.NextAddress()
reclaimAddr := reclaimUC.UnlockHash()
......
......@@ -207,7 +207,7 @@ func TestMisuseApplySiacoinOutputs(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Error("no panic occured when misusing applySiacoinInput")
t.Error("no panic occurred when misusing applySiacoinInput")
}
}()
cst.cs.applySiacoinOutputs(pb, txn)
......@@ -306,7 +306,7 @@ func TestMisuseApplyFileContracts(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Error("no panic occured when misusing applySiacoinInput")
t.Error("no panic occurred when misusing applySiacoinInput")
}
}()
cst.cs.applyFileContracts(pb, txn)
......@@ -433,7 +433,7 @@ func TestMisuseApplyFileContractRevisions(t *testing.T) {
defer func() {
r := recover()
if r != errNilItem {
t.Error("no panic occured when misusing applySiacoinInput")
t.Error("no panic occurred when misusing applySiacoinInput")
}
}()
txn := types.Transaction{
......@@ -584,7 +584,7 @@ func TestNonexistentStorageProof(t *testing.T) {
defer func() {
r := recover()
if r != errNilItem {
t.Error("no panic occured when misusing applySiacoinInput")
t.Error("no panic occurred when misusing applySiacoinInput")
}
}()
txn := types.Transaction{
......@@ -725,7 +725,7 @@ func TestMisuseApplySiafundInputs(t *testing.T) {
defer func() {
r := recover()
if r != ErrMisuseApplySiafundInput {
t.Error("no panic occured when misusing applySiacoinInput")
t.Error("no panic occurred when misusing applySiacoinInput")
t.Error(r)
}
}()
......@@ -826,7 +826,7 @@ func TestMisuseApplySiafundOutputs(t *testing.T) {
defer func() {
r := recover()
if r != ErrMisuseApplySiafundOutput {
t.Error("no panic occured when misusing applySiafundInput")
t.Error("no panic occurred when misusing applySiafundInput")
}
}()
cst.cs.applySiafundOutputs(pb, txn)
......
......@@ -93,7 +93,7 @@ func appendChangeLog(tx *bolt.Tx, ce changeEntry) error {
}
// getEntry returns the change entry with a given id, using a bool to indicate
// existance.
// existence.
func getEntry(tx *bolt.Tx, id modules.ConsensusChangeID) (ce changeEntry, exists bool) {
var cn changeNode
cl := tx.Bucket(ChangeLog)
......
......@@ -92,7 +92,7 @@ func dbInitialized(tx *bolt.Tx) bool {
}
// initDB is run if there is no existing consensus database, creating a
// database with all the required buckets and sane inital values.
// database with all the required buckets and sane initial values.
func (cs *ConsensusSet) initDB(tx *bolt.Tx) error {
// Create the compononents of the database.
err := cs.createConsensusDB(tx)
......
......@@ -22,7 +22,7 @@ var (
errWrongRevertDiffSet = errors.New("reverting a diff set that isn't the current block")
)
// commitDiffSetSanity performs a series of sanity checks before commiting a
// commitDiffSetSanity performs a series of sanity checks before committing a
// diff set.
func commitDiffSetSanity(tx *bolt.Tx, pb *processedBlock, dir modules.DiffDirection) {
// This function is purely sanity checks.
......
......@@ -112,7 +112,7 @@ func (cs *ConsensusSet) initializeSubscribe(subscriber modules.ConsensusSetSubsc
if start == modules.ConsensusChangeBeginning {
// Special case: for modules.ConsensusChangeBeginning, create an
// initial node pointing to the genesis block. The subscriber will
// recieve the diffs for all blocks in the consensus set, including
// receive the diffs for all blocks in the consensus set, including
// the genesis block.
entry = cs.genesisEntry()
exists = true
......@@ -153,8 +153,8 @@ func (cs *ConsensusSet) initializeSubscribe(subscriber modules.ConsensusSetSubsc
}
// ConsensusSetSubscribe adds a subscriber to the list of subscribers, and
// gives them every consensus change that has occured since the change with the
// provided id.
// gives them every consensus change that has occurred since the change with
// the provided id.
//
// As a special case, using an empty id as the start will have all the changes
// sent to the modules starting with the genesis block.
......
......@@ -286,7 +286,7 @@ func TestInitialBlockchainDownloadDoneRules(t *testing.T) {
}
// Set minIBDWaitTime to 1s for just this test because no blocks are
// transfered between peers so the wait time can be very short.
// transferred between peers so the wait time can be very short.
actualMinIBDWaitTime := minIBDWaitTime
defer func() {
minIBDWaitTime = actualMinIBDWaitTime
......
......@@ -64,7 +64,7 @@ func New(cs modules.ConsensusSet, persistDir string) (*Explorer, error) {
persistDir: persistDir,
}
// Intialize the persistent structures, including the database.
// Initialize the persistent structures, including the database.
err := e.initPersist()
if err != nil {
return nil, err
......
......@@ -115,7 +115,7 @@ func TestRandomNode(t *testing.T) {
nodes[addr]++
}
for node, count := range nodes {
if count == 0 { // 1-in-200000 chance of occuring naturally
if count == 0 { // 1-in-200000 chance of occurring naturally
t.Errorf("node %v was never selected", node)
}
}
......
......@@ -39,7 +39,7 @@ func TestRPC(t *testing.T) {
defer g1.Close()
if err := g1.RPC("foo.com:123", "", nil); err == nil {
t.Fatal("RPC on unconnected peer succeded")
t.Fatal("RPC on unconnected peer succeeded")
}
g2 := newTestingGateway("TestRPC2", t)
......
......@@ -192,7 +192,7 @@ var (
// store the heights sorted in numerical order. The action item itself is
// an array of file contract ids. The host is able to contextually figure
// out what the necessary actions for that item are based on the file
// contract id and the associated storage obligation that can be retreived
// contract id and the associated storage obligation that can be retrieved
// using the id.
bucketActionItems = []byte("BucketActionItems")
......
......@@ -26,7 +26,7 @@ var (
)
// These interfaces define the Host's dependencies. Mocking implementation
// complexity can be reduced by defining each dependency as the minimium
// complexity can be reduced by defining each dependency as the minimum
// possible subset of the real dependency.
type (
// dependencies defines all of the dependencies of the Host.
......
......@@ -170,7 +170,7 @@ type Host struct {
// Storage is broken up into sectors. The sectors are distributed across a
// set of storage folders using a strategy that tries to create even
// distributions, but not aggressively. Uneven distributions could be
// manufactured by an attacker given sufficent knowledge about the disk
// manufactured by an attacker given sufficient knowledge about the disk
// layout (knowledge which should be unavailable), but a limited amount of
// damage can be done even with this attack.
lockedStorageObligations map[types.FileContractID]struct{} // Which storage obligations are currently being modified.
......@@ -279,9 +279,9 @@ func newHost(dependencies dependencies, cs modules.ConsensusSet, tpool modules.T
_ = h.log.Close()
return nil, err
}
// After opening the database, it must be initalized. Most commonly,
// After opening the database, it must be initialized. Most commonly,
// nothing happens. But for new databases, a set of buckets must be
// created. Intialization is also a good time to run sanity checks.
// created. Initialization is also a good time to run sanity checks.
err = h.initDB()
if err != nil {
_ = h.log.Close()
......@@ -289,7 +289,7 @@ func newHost(dependencies dependencies, cs modules.ConsensusSet, tpool modules.T
return nil, err
}
// Load the prior persistance structures.
// Load the prior persistence structures.
err = h.load()
if err != nil {
_ = h.log.Close()
......
......@@ -198,7 +198,7 @@ func newHostTester(name string) (*hostTester, error) {
return ht, nil
}
// TestHostInitialization checks that the host intializes to sensisble default
// TestHostInitialization checks that the host initializes to sensible default
// values.
func TestHostInitialization(t *testing.T) {
if testing.Short() {
......
......@@ -12,7 +12,7 @@ import (
var (
// errDownloadBadHostValidOutputs is returned if the renter requests a
// download and pays an insufficent amount to the host valid addresses.
// download and pays an insufficient amount to the host valid addresses.
errDownloadBadHostValidOutputs = errors.New("download request rejected for bad host valid outputs")
// errDownloadBadNewFileMerkleRoot is returned if the renter requests a
......
......@@ -14,7 +14,7 @@ import (
var (
// errBadModificationIndex is returned if the renter requests a change on a
// sector root that is not in the file contract.
errBadModificationIndex = errors.New("renter has made a modification that points to a nonexistant sector")
errBadModificationIndex = errors.New("renter has made a modification that points to a nonexistent sector")
// badSectorSize is returned if the renter provides a sector to be inserted
// that is the wrong size.
......
......@@ -98,7 +98,7 @@ func (h *Host) threadedHandleConn(conn net.Conn) {
}
defer conn.Close()
// Read a specifier indicating which action is beeing called.
// Read a specifier indicating which action is being called.
var id types.Specifier
if err := encoding.ReadObject(conn, &id, 16); err != nil {
atomic.AddUint64(&h.atomicUnrecognizedCalls, 1)
......
......@@ -4,7 +4,7 @@ import (
"errors"
)
// consistency.go contians a bunch of consistency checks for the host. Because
// consistency.go contains a bunch of consistency checks for the host. Because
// a lot of the consistency is checking that different parts of the host match
// up, it was decided that all consistency checking should go into a single
// file. As an example, the state of the storage obligations sets the standard
......
......@@ -74,7 +74,7 @@ var (
// actually frustrate price planning. 32 GB has been chosen as a minimum
// for the early days of the network, to allow people to experiment in the
// beta, but in the future I think something like 256GB would be much more
// appropraite.
// appropriate.
minimumStorageFolderSize = func() uint64 {
if build.Release == "dev" {
return 1 << 25 // 32 MiB
......
......@@ -26,7 +26,7 @@ var (
// These interfaces define the StorageManager's dependencies. Mocking
// implementation complexity can be reduced by defining each dependency as the
// minimium possible subset of the real dependency.
// minimum possible subset of the real dependency.
type (
// dependencies defines all of the dependencies of the StorageManager.
dependencies interface {
......
......@@ -120,7 +120,7 @@ var (
// files. These files have long, cryptographic names and may take up as much as
// a gigabyte of space in filesystem overhead, depending on how the filesystem
// is architected. The host is programmed to gracefully handle full disks, so
// wihle it might cause the user surprise that the host can't break past 99%
// while it might cause the user surprise that the host can't break past 99%
// utilization, there should not be any issues if the user overestimates how
// much storage is available in the folder they have offered to Sia. The host
// will put the drive at 100% utilization, which may cause performance
......
......@@ -83,7 +83,7 @@ func (faultyRemove) removeFile(s string) error {
}
// TestStorageFolderTolerance tests the tolerance of storage folders in the
// presense of disk failures. Disk failures should be recorded, and the
// presence of disk failures. Disk failures should be recorded, and the
// failures should be handled gracefully - nonfailing disks should not have
// problems.
func TestStorageFolderTolerance(t *testing.T) {
......
......@@ -323,7 +323,7 @@ func TestStorageFolderUsage(t *testing.T) {
if totalStorage != remainingStorage+modules.SectorSize {
t.Fatal("manager is not empty at the moment of creating the in-memory sector usage map")
}
// Verify that the inital sector usage map was created correctly.
// Verify that the initial sector usage map was created correctly.
err = smt.sectorUsageCheck(sectorUsageMap)
if err != nil {
t.Fatal(err)
......
......@@ -130,7 +130,7 @@ func TestAddStorageFolderUIDCollisions(t *testing.T) {
// another one repeatedly - enough times to exceed the 256 possible folder
// UIDs that can be chosen in the testing environment.
for i := 0; i < 300; i++ {
// Repalce the very first storage folder.
// Replace the very first storage folder.
err = smt.sm.RemoveStorageFolder(0, false)
if err != nil {
t.Fatal(err)
......
......@@ -133,9 +133,9 @@ func newStorageManager(dependencies dependencies, persistDir string) (*StorageMa
_ = sm.log.Close()
return nil, err
}
// After opening the database, it must be initalized. Most commonly,
// After opening the database, it must be initialized. Most commonly,
// nothing happens. But for new databases, a set of buckets must be
// created. Intialization is also a good time to run sanity checks.
// created. Initialization is also a good time to run sanity checks.
err = sm.initDB()
if err != nil {
_ = sm.log.Close()
......@@ -143,7 +143,7 @@ func newStorageManager(dependencies dependencies, persistDir string) (*StorageMa
return nil, err
}
// Load the prior persistance structures.
// Load the prior persistence structures.
err = sm.load()
if err != nil {
_ = sm.log.Close()
......
......@@ -757,7 +757,7 @@ func (h *Host) handleActionItem(so *storageObligation) {
h.log.Println(err)
}
// Check if all items have succeded with the required confirmations. Report
// Check if all items have succeeded with the required confirmations. Report
// success, delete the obligation.
//
// TODO: This doesn't actually wait enough blocks?
......
......@@ -14,7 +14,7 @@ import (
"github.com/NebulousLabs/bolt"
)
// initRescan is a helper funtion of initConsensusSubscribe, and is called when
// initRescan is a helper function of initConsensusSubscribe, and is called when
// the host and the consensus set have become desynchronized. Desynchronization
// typically happens if the user is replacing or altering the persistent files
// in the consensus set or the host.
......
......@@ -16,7 +16,8 @@ func (m *Miner) threadedMine() {
m.mining = true
m.mu.Unlock()
// Solve blocks repeatedly, keeping track of how fast hashing is occuring.
// Solve blocks repeatedly, keeping track of how fast hashing is
// occurring.
cycleStart := time.Now()
for {
// Kill the thread if mining has been turned off.
......
......@@ -180,7 +180,7 @@ func newContractor(cs consensusSet, w wallet, tp transactionPool, hdb hostDB, d
contracts: make(map[types.FileContractID]Contract),
}
// Load the prior persistance structures.
// Load the prior persistence structures.
err := c.load()
if err != nil && !os.IsNotExist(err) {
return nil, err
......
......@@ -109,7 +109,7 @@ func newHostDB(cs consensusSet, d dialer, s sleeper, p persister, l *persist.Log
scanPool: make(chan *hostEntry, scanPoolSize),
}
// Load the prior persistance structures.
// Load the prior persistence structures.
err := hdb.load()
if err != nil && !os.IsNotExist(err) {
return nil, err
......
......@@ -397,7 +397,7 @@ func (r *Renter) loadSharedFiles(reader io.Reader) ([]string, error) {
}
// initPersist handles all of the persistence initialization, such as creating
// the persistance directory and starting the logger.
// the persistence directory and starting the logger.
func (r *Renter) initPersist() error {
// Create the perist directory if it does not yet exist.
err := os.MkdirAll(r.persistDir, 0700)
......@@ -411,7 +411,7 @@ func (r *Renter) initPersist() error {
return err
}
// Load the prior persistance structures.
// Load the prior persistence structures.
err = r.load()
if err != nil && !os.IsNotExist(err) {
return err
......
......@@ -162,7 +162,7 @@ func newContractorTester(name string, hc hostContractor) (*renterTester, error)
return rt, nil
}
// stubHostDB is the minimal implemention of the hostDB interface. It can be
// stubHostDB is the minimal implementation of the hostDB interface. It can be
// embedded in other mock hostDB types, removing the need to reimplement all
// of the hostDB's methods on every mock.
type stubHostDB struct{}
......
......@@ -12,7 +12,7 @@ const (
)
type (
// StorageFolderMetadata contians metadata about a storage folder that is
// StorageFolderMetadata contains metadata about a storage folder that is
// tracked by the storage folder manager.
StorageFolderMetadata struct {
Capacity uint64 `json:"capacity"`
......
......@@ -23,7 +23,7 @@ func (tp *TransactionPool) updateSubscribersTransactions() {
// TransactionPoolSubscribe adds a subscriber to the transaction pool.
// Subscribers will receive the full transaction set every time there is a
// signficant change to the transaction pool.
// significant change to the transaction pool.
func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber) {
tp.mu.Lock()
defer tp.mu.Unlock()
......
......@@ -27,7 +27,7 @@ type (
// rejecting them based on internal criteria such as fees and unconfirmed
// double spends.
TransactionPool struct {
// Depedencies of the transaction pool.
// Dependencies of the transaction pool.
consensusSet modules.ConsensusSet
gateway modules.Gateway
......
......@@ -7,7 +7,7 @@ import (
"github.com/NebulousLabs/Sia/types"
)
// TestArbDataOnly tries submitting a transaction with only aribtrary data to
// TestArbDataOnly tries submitting a transaction with only arbitrary data to
// the transaction pool. Then a block is mined, putting the transaction on the
// blockchain. The arb data transaction should no longer be in the transaction
// pool.
......
......@@ -11,7 +11,7 @@ import (
)
const (
// WalletDir is the directory that contains the wallet persistance.
// WalletDir is the directory that contains the wallet persistence.
WalletDir = "wallet"
// SeedChecksumSize is the number of bytes that are used to checksum
......@@ -101,7 +101,7 @@ type (
}
// TransactionBuilder is used to construct custom transactions. A transaction
// builder is intialized via 'RegisterTransaction' and then can be modified by
// builder is initialized via 'RegisterTransaction' and then can be modified by
// adding funds or other fields. The transaction is completed by calling
// 'Sign', which will sign all inputs added via the 'FundSiacoins' or
// 'FundSiafunds' call. All modifications are additive.
......
......@@ -113,7 +113,7 @@ func TestIntegrationPreEncryption(t *testing.T) {
t.Fatal(err)
}
if w1.Encrypted() {
t.Error("wallet is reporting that it has been encrypted when no such action has occured")
t.Error("wallet is reporting that it has been encrypted when no such action has occurred")
}
if w1.Unlocked() {
t.Error("new wallet is not being treated as locked")
......
......@@ -248,7 +248,7 @@ func (w *Wallet) PrimarySeed() (modules.Seed, uint64, error) {
return w.primarySeed, w.persist.PrimarySeedProgress, nil
}
// NextAddress returns an unlock hash that is ready to recieve siacoins or
// NextAddress returns an unlock hash that is ready to receive siacoins or
// siafunds. The address is generated using the primary address seed.
func (w *Wallet) NextAddress() (types.UnlockConditions, error) {
w.mu.Lock()
......
......@@ -68,7 +68,7 @@ func TestIntegrationTransactions(t *testing.T) {
t.Fatal(err)
}
// The partial should include one transaction for a block, and 2 for the
// send that occured.
// send that occurred.
if len(txns) != 3 {
t.Error(len(txns))
}
......
......@@ -76,9 +76,9 @@ func TestAbsolutePathSafeFile(t *testing.T) {
}
// TestRelativePathSafeFile tests creating and committing safe files with
// relative paths. Relative paths are testing to test that calling os.Chdir
// inbetween creating and committing a safe file doesn't affect the safe file's
// final path. The relative path tested is relative to the working directory.
// relative paths. Specifically, we test that calling os.Chdir between creating
// and committing a safe file doesn't affect the safe file's final path. The
// relative path tested is relative to the working directory.
func TestRelativePathSafeFile(t *testing.T) {
tmpDir := build.TempDir(persistDir, "TestRelativePathSafeFile")
err := os.MkdirAll(tmpDir, 0700)
......
......@@ -37,7 +37,7 @@ func StartCPUProfile(profileDir, identifier string) error {
cpuLock.Unlock()
// Start profiling into the profile dir, using the identifer. The timestamp
// of the start time of the profiling will be included in the filenmae.
// of the start time of the profiling will be included in the filename.
cpuProfileFile, err := os.Create(filepath.Join(profileDir, "cpu-profile-"+identifier+"-"+time.Now().Format(time.RFC3339Nano)+".prof"))
if err != nil {
return err
......
......@@ -159,7 +159,7 @@ will be overwritten.
* `siac renter share [nickname] [filepath]` writes a .sia file
pointing to the file specified by `nickname` on the network. The file
is written to `filepath`. Note that the `.sia` extention will not be
is written to `filepath`. Note that the `.sia` extension will not be
automatically added, and must be part of the path.
* `siac renter shareascii [nickname]` writes the .sia file specified
......
......@@ -147,7 +147,7 @@ Run 'wallet send --help' to see a list of available units.`,
)
// walletaddresscmd fetches a new address from the wallet that will be able to
// recieve coins.
// receive coins.
func walletaddresscmd() {
addr := new(api.WalletAddressGET)
err := getAPI("/wallet/address", addr)
......
......@@ -227,7 +227,7 @@ func TestNegativeCurrencyMulRat(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Error("no panic occured when trying to create a negative currency")
t.Error("no panic occurred when trying to create a negative currency")
}
}()
......@@ -242,7 +242,7 @@ func TestNegativeCurrencySub(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Error("no panic occured when trying to create a negative currency")
t.Error("no panic occurred when trying to create a negative currency")
}
}()
......@@ -291,7 +291,7 @@ func TestNegativeNewCurrency(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Error("no panic occured when trying to create a negative currency")
t.Error("no panic occurred when trying to create a negative currency")
}
}()
......
......@@ -321,7 +321,7 @@ func TestTransactionValidSignatures(t *testing.T) {
}
txn.TransactionSignatures[0] = tmpTxn0
// Try to point to a nonexistant public key.
// Try to point to a nonexistent public key.
txn.TransactionSignatures[0] = TransactionSignature{PublicKeyIndex: 5}
err = txn.validSignatures(10)
if err != ErrInvalidPubKeyIndex {
......
......@@ -106,7 +106,7 @@ func TestTargetMul(t *testing.T) {
target14[crypto.HashSize-1] = 14
target20[crypto.HashSize-1] = 20
// Multiplying the difficulty of a target at '10' by 5 will yeild a target
// Multiplying the difficulty of a target at '10' by 5 will yield a target
// of '2'. Similar math follows for the remaining checks.
expect2 := target10.MulDifficulty(big.NewRat(5, 1))
if expect2 != target2 {
......@@ -164,7 +164,7 @@ func TestTargetNegativeIntToTarget(t *testing.T) {
defer func() {
r := recover()
if r != ErrNegativeTarget {
t.Error("no panic occured when trying to create a negative target")
t.Error("no panic occurred when trying to create a negative target")
}
}()
b := big.NewInt(-3)
......@@ -183,7 +183,7 @@ func TestTargetNegativeRatToTarget(t *testing.T) {