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