Commit 67fa76eb authored by Frank's avatar Frank Committed by GitHub

chore: fix comment typo (#1928)

parent f621d41b
......@@ -59,7 +59,7 @@ type Interface interface {
// Action represents an accounting action that can be applied
type Action interface {
// Cleanup cleans up an action. Must be called wether it was applied or not.
// Cleanup cleans up an action. Must be called whether it was applied or not.
Cleanup()
// Apply applies an action
Apply() error
......@@ -106,11 +106,11 @@ type Accounting struct {
earlyPayment *big.Int
// Limit to disconnect peer after going in debt over
disconnectLimit *big.Int
// function used for monetory settlement
// function used for monetary settlement
payFunction PayFunc
// function used for time settlement
refreshFunction RefreshFunc
// allowance based on time used in pseudosettle
// allowance based on time used in pseudo settle
refreshRate *big.Int
// lower bound for the value of issued cheques
minimumPayment *big.Int
......@@ -290,7 +290,7 @@ func (a *Accounting) settle(peer swarm.Address, balance *accountingPeer) error {
paymentAmount := new(big.Int).Neg(compensatedBalance)
// Don't do anything if there is no actual debt or no time passed since last refreshment attempt
// This might be the case if the peer owes us and the total reserve for a peer exceeds the payment treshold.
// This might be the case if the peer owes us and the total reserve for a peer exceeds the payment threshold.
if paymentAmount.Cmp(big.NewInt(0)) > 0 && timeElapsed > 0 {
shadowBalance, err := a.shadowBalance(peer)
if err != nil {
......
......@@ -269,7 +269,7 @@ func TestAccountingCallSettlement(t *testing.T) {
t.Fatal(err)
}
// Credit until payment treshold
// Credit until payment threshold
err = acc.Credit(peer1Addr, requestPrice)
if err != nil {
t.Fatal(err)
......@@ -315,7 +315,7 @@ func TestAccountingCallSettlement(t *testing.T) {
t.Fatal(err)
}
// Credit until the expected debt exceeeds payment threshold
// Credit until the expected debt exceeds payment threshold
expectedAmount := testPaymentThreshold.Uint64() - 101
err = acc.Reserve(context.Background(), peer1Addr, expectedAmount)
if err != nil {
......@@ -393,7 +393,7 @@ func TestAccountingCallSettlementMonetary(t *testing.T) {
t.Fatal(err)
}
// Credit until payment treshold
// Credit until payment threshold
err = acc.Credit(peer1Addr, requestPrice)
if err != nil {
t.Fatal(err)
......@@ -446,7 +446,7 @@ func TestAccountingCallSettlementMonetary(t *testing.T) {
return big.NewInt(0), 0, nil
})
// Credit until the expected debt exceeeds payment threshold
// Credit until the expected debt exceeds payment threshold
expectedAmount := testPaymentThreshold.Uint64()
err = acc.Reserve(context.Background(), peer1Addr, expectedAmount)
......@@ -510,7 +510,7 @@ func TestAccountingCallSettlementTooSoon(t *testing.T) {
t.Fatal(err)
}
// Credit until payment treshold
// Credit until payment threshold
err = acc.Credit(peer1Addr, requestPrice)
if err != nil {
t.Fatal(err)
......@@ -553,7 +553,7 @@ func TestAccountingCallSettlementTooSoon(t *testing.T) {
t.Fatal(err)
}
// Credit until payment treshold
// Credit until payment threshold
err = acc.Credit(peer1Addr, requestPrice)
if err != nil {
t.Fatal(err)
......@@ -742,7 +742,7 @@ func TestAccountingSurplusBalance(t *testing.T) {
t.Fatal("Unexpected error from Credit")
}
debitAction.Cleanup()
// samity check surplus balance
// sanity check surplus balance
val, err = acc.SurplusBalance(peer1Addr)
if err != nil {
t.Fatal("Error checking Surplusbalance")
......@@ -765,7 +765,7 @@ func TestAccountingSurplusBalance(t *testing.T) {
t.Fatal("Unexpected error from Debit")
}
debitAction.Cleanup()
// samity check surplus balance
// sanity check surplus balance
val, err = acc.SurplusBalance(peer1Addr)
if err != nil {
t.Fatal("Error checking Surplusbalance")
......
......@@ -4,6 +4,6 @@
/*
Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount.
Its purpose is to be able to have the full payment / disconnect treshold machinery in place without having to send cheques or real values.
Its purpose is to be able to have the full payment / disconnect threshold machinery in place without having to send cheques or real values.
*/
package pseudosettle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment