Commit 111ca35a authored by chuwt's avatar chuwt Committed by GitHub

chore: fix typos (#2320)

parent 3289c621
......@@ -104,7 +104,7 @@ func TestConnect(t *testing.T) {
func TestDisconnect(t *testing.T) {
address := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c")
unknownAdddress := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59e")
unknownAddress := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59e")
errorAddress := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59a")
testErr := errors.New("test error")
......@@ -132,7 +132,7 @@ func TestDisconnect(t *testing.T) {
})
t.Run("unknown", func(t *testing.T) {
jsonhttptest.Request(t, testServer.Client, http.MethodDelete, "/peers/"+unknownAdddress.String(), http.StatusBadRequest,
jsonhttptest.Request(t, testServer.Client, http.MethodDelete, "/peers/"+unknownAddress.String(), http.StatusBadRequest,
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
Code: http.StatusBadRequest,
Message: "peer not found",
......
......@@ -56,7 +56,7 @@ var (
// AdvertisableAddressResolver can Resolve a Multiaddress.
type AdvertisableAddressResolver interface {
Resolve(observedAdddress ma.Multiaddr) (ma.Multiaddr, error)
Resolve(observedAddress ma.Multiaddr) (ma.Multiaddr, error)
}
type SenderMatcher interface {
......
......@@ -729,7 +729,7 @@ type AdvertisableAddresserMock struct {
err error
}
func (a *AdvertisableAddresserMock) Resolve(observedAdddress ma.Multiaddr) (ma.Multiaddr, error) {
func (a *AdvertisableAddresserMock) Resolve(observedAddress ma.Multiaddr) (ma.Multiaddr, error) {
if a.err != nil {
return nil, a.err
}
......@@ -738,7 +738,7 @@ func (a *AdvertisableAddresserMock) Resolve(observedAdddress ma.Multiaddr) (ma.M
return a.advertisableAddress, nil
}
return observedAdddress, nil
return observedAddress, nil
}
type MockSenderMatcher struct {
......
......@@ -14,7 +14,7 @@ import (
"github.com/ethersphere/bee/pkg/swarm"
)
func TestENSntegration(t *testing.T) {
func TestENSIntegration(t *testing.T) {
// TODO: consider using a stable gateway instead of INFURA.
defaultEndpoint := "https://goerli.infura.io/v3/59d83a5a4be74f86b9851190c802297b"
defaultAddr := swarm.MustParseHexAddress("00cb23598c2e520b6a6aae3ddc94fed4435a2909690bdd709bf9d9e7c2aadfad")
......
......@@ -14,7 +14,7 @@ const SwarmContentHashPrefix = swarmContentHashPrefix
var ErrNotImplemented = errNotImplemented
// WithConnectFunc will set the Dial function implementaton.
// WithConnectFunc will set the Dial function implementation.
func WithConnectFunc(fn func(endpoint string, contractAddr string) (*ethclient.Client, *goens.Registry, error)) Option {
return func(c *Client) {
c.connectFn = fn
......
......@@ -42,7 +42,7 @@ type Service struct {
cashoutStatusFunc func(ctx context.Context, peer swarm.Address) (*chequebook.CashoutStatus, error)
}
// WithsettlementFunc sets the mock settlement function
// WithSettlementSentFunc sets the mock settlement function
func WithSettlementSentFunc(f func(swarm.Address) (*big.Int, error)) Option {
return optionFunc(func(s *Service) {
s.settlementSentFunc = f
......@@ -55,7 +55,7 @@ func WithSettlementRecvFunc(f func(swarm.Address) (*big.Int, error)) Option {
})
}
// WithsettlementsFunc sets the mock settlements function
// WithSettlementsSentFunc sets the mock settlements function
func WithSettlementsSentFunc(f func() (map[string]*big.Int, error)) Option {
return optionFunc(func(s *Service) {
s.settlementsSentFunc = f
......
......@@ -296,7 +296,7 @@ func encodeInt64Append(buffer *[]byte, val int64) {
}
func decodeInt64Splice(buffer *[]byte) int64 {
val, n := binary.Varint((*buffer))
val, n := binary.Varint(*buffer)
*buffer = (*buffer)[n:]
return val
}
......
......@@ -155,10 +155,10 @@ func New(
func (k *Kad) generateCommonBinPrefixes() {
bitCombinationsCount := int(math.Pow(2, float64(k.bitSuffixLength)))
bitSufixes := make([]uint8, bitCombinationsCount)
bitSuffixes := make([]uint8, bitCombinationsCount)
for i := 0; i < bitCombinationsCount; i++ {
bitSufixes[i] = uint8(i)
bitSuffixes[i] = uint8(i)
}
addr := swarm.MustParseHexAddress(k.base.String())
......@@ -197,7 +197,7 @@ func (k *Kad) generateCommonBinPrefixes() {
for l := i + 1; l < i+k.bitSuffixLength+1; l++ {
index, pos := l/8, l%8
if hasBit(bitSufixes[j], uint8(bitSuffixPos)) {
if hasBit(bitSuffixes[j], uint8(bitSuffixPos)) {
pseudoAddrBytes[index] = bits.Reverse8(setBit(bits.Reverse8(pseudoAddrBytes[index]), uint8(pos)))
} else {
pseudoAddrBytes[index] = bits.Reverse8(clearBit(bits.Reverse8(pseudoAddrBytes[index]), uint8(pos)))
......
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