diff --git a/dapps/valuetransfers/packages/tangle/payloadmetadata.go b/dapps/valuetransfers/packages/tangle/payloadmetadata.go index 414561c6b6862ff287d38816f7dc7056c18d989e..be575207930db9ff5107719e43e1c623400dace3 100644 --- a/dapps/valuetransfers/packages/tangle/payloadmetadata.go +++ b/dapps/valuetransfers/packages/tangle/payloadmetadata.go @@ -137,8 +137,8 @@ func (payloadMetadata *PayloadMetadata) setSolid(solid bool) (modified bool) { return } -// SoldificationTime returns the time when the payload was marked to be solid. -func (payloadMetadata *PayloadMetadata) SoldificationTime() time.Time { +// SolidificationTime returns the time when the payload was marked to be solid. +func (payloadMetadata *PayloadMetadata) SolidificationTime() time.Time { payloadMetadata.solidificationTimeMutex.RLock() defer payloadMetadata.solidificationTimeMutex.RUnlock() @@ -286,7 +286,7 @@ func (payloadMetadata *PayloadMetadata) String() string { return stringify.Struct("PayloadMetadata", stringify.StructField("payloadId", payloadMetadata.PayloadID()), stringify.StructField("solid", payloadMetadata.IsSolid()), - stringify.StructField("solidificationTime", payloadMetadata.SoldificationTime()), + stringify.StructField("solidificationTime", payloadMetadata.SolidificationTime()), ) } @@ -305,7 +305,7 @@ func (payloadMetadata *PayloadMetadata) Update(other objectstorage.StorableObjec // ObjectStorageValue is required to match the encoding.BinaryMarshaler interface. func (payloadMetadata *PayloadMetadata) ObjectStorageValue() []byte { return marshalutil.New(marshalutil.TIME_SIZE + 4*marshalutil.BOOL_SIZE). - WriteTime(payloadMetadata.SoldificationTime()). + WriteTime(payloadMetadata.SolidificationTime()). WriteBool(payloadMetadata.IsSolid()). WriteBool(payloadMetadata.Liked()). WriteBool(payloadMetadata.Confirmed()). diff --git a/dapps/valuetransfers/packages/tangle/payloadmetadata_test.go b/dapps/valuetransfers/packages/tangle/payloadmetadata_test.go index 501bcf792c5c193fbe319e10366500f7a8dd6388..ff194d0bfa6296426045c49e745e10330b458d8d 100644 --- a/dapps/valuetransfers/packages/tangle/payloadmetadata_test.go +++ b/dapps/valuetransfers/packages/tangle/payloadmetadata_test.go @@ -18,7 +18,7 @@ func TestMarshalUnmarshal(t *testing.T) { assert.Equal(t, originalMetadata.PayloadID(), clonedMetadata.PayloadID()) assert.Equal(t, originalMetadata.IsSolid(), clonedMetadata.IsSolid()) - assert.Equal(t, originalMetadata.SoldificationTime().Round(time.Second), clonedMetadata.SoldificationTime().Round(time.Second)) + assert.Equal(t, originalMetadata.SolidificationTime().Round(time.Second), clonedMetadata.SolidificationTime().Round(time.Second)) originalMetadata.setSolid(true) @@ -29,17 +29,17 @@ func TestMarshalUnmarshal(t *testing.T) { assert.Equal(t, originalMetadata.PayloadID(), clonedMetadata.PayloadID()) assert.Equal(t, originalMetadata.IsSolid(), clonedMetadata.IsSolid()) - assert.Equal(t, originalMetadata.SoldificationTime().Round(time.Second), clonedMetadata.SoldificationTime().Round(time.Second)) + assert.Equal(t, originalMetadata.SolidificationTime().Round(time.Second), clonedMetadata.SolidificationTime().Round(time.Second)) } func TestPayloadMetadata_SetSolid(t *testing.T) { originalMetadata := NewPayloadMetadata(payload.GenesisID) assert.Equal(t, false, originalMetadata.IsSolid()) - assert.Equal(t, time.Time{}, originalMetadata.SoldificationTime()) + assert.Equal(t, time.Time{}, originalMetadata.SolidificationTime()) originalMetadata.setSolid(true) assert.Equal(t, true, originalMetadata.IsSolid()) - assert.Equal(t, time.Now().Round(time.Second), originalMetadata.SoldificationTime().Round(time.Second)) + assert.Equal(t, time.Now().Round(time.Second), originalMetadata.SolidificationTime().Round(time.Second)) } diff --git a/dapps/valuetransfers/packages/tangle/tangle_test.go b/dapps/valuetransfers/packages/tangle/tangle_test.go index aab20994b3729d5f1179bf2ffaa1574d89e15c9b..b0d1273e98b444a5c9084b2281c420216458d248 100644 --- a/dapps/valuetransfers/packages/tangle/tangle_test.go +++ b/dapps/valuetransfers/packages/tangle/tangle_test.go @@ -247,7 +247,7 @@ func TestMoveTransactionToBranch(t *testing.T) { cachedTransaction, cachedTransactionMetadata, _, _ := tangle.storeTransactionModels(valueObject) txMetadata := cachedTransactionMetadata.Unwrap() - // create conflicting branche + // create conflicting branch cachedBranch2, _ := tangle.BranchManager().Fork(branchmanager.BranchID{2}, []branchmanager.BranchID{branchmanager.MasterBranchID}, []branchmanager.ConflictID{{0}}) defer cachedBranch2.Release() diff --git a/dapps/valuetransfers/packages/tangle/transactionmetadata.go b/dapps/valuetransfers/packages/tangle/transactionmetadata.go index 22b832fef18bc4fd2638c2c15dfe1b1772069084..753e70593a2e141c092ff2553a31e340d386c3ee 100644 --- a/dapps/valuetransfers/packages/tangle/transactionmetadata.go +++ b/dapps/valuetransfers/packages/tangle/transactionmetadata.go @@ -354,8 +354,8 @@ func (transactionMetadata *TransactionMetadata) FinalizationTime() time.Time { return transactionMetadata.finalizationTime } -// SoldificationTime returns the time when the Transaction was marked to be solid. -func (transactionMetadata *TransactionMetadata) SoldificationTime() time.Time { +// SolidificationTime returns the time when the Transaction was marked to be solid. +func (transactionMetadata *TransactionMetadata) SolidificationTime() time.Time { transactionMetadata.solidificationTimeMutex.RLock() defer transactionMetadata.solidificationTimeMutex.RUnlock() @@ -366,7 +366,7 @@ func (transactionMetadata *TransactionMetadata) SoldificationTime() time.Time { func (transactionMetadata *TransactionMetadata) Bytes() []byte { return marshalutil.New(branchmanager.BranchIDLength + 2*marshalutil.TIME_SIZE + 6*marshalutil.BOOL_SIZE). WriteBytes(transactionMetadata.BranchID().Bytes()). - WriteTime(transactionMetadata.SoldificationTime()). + WriteTime(transactionMetadata.SolidificationTime()). WriteTime(transactionMetadata.FinalizationTime()). WriteBool(transactionMetadata.Solid()). WriteBool(transactionMetadata.Preferred()). @@ -383,7 +383,7 @@ func (transactionMetadata *TransactionMetadata) String() string { stringify.StructField("id", transactionMetadata.ID()), stringify.StructField("branchId", transactionMetadata.BranchID()), stringify.StructField("solid", transactionMetadata.Solid()), - stringify.StructField("solidificationTime", transactionMetadata.SoldificationTime()), + stringify.StructField("solidificationTime", transactionMetadata.SolidificationTime()), ) } diff --git a/packages/binary/datastructure/orderedmap/orderedmap.go b/packages/binary/datastructure/orderedmap/orderedmap.go index 22b62588cb67af73058aa7ab3d681bfc6db1fd5c..dc6f19be417e3818dc745614b7ba2e6131cf117f 100644 --- a/packages/binary/datastructure/orderedmap/orderedmap.go +++ b/packages/binary/datastructure/orderedmap/orderedmap.go @@ -91,7 +91,7 @@ func (orderedMap *OrderedMap) ForEach(consumer func(key, value interface{}) bool return true } -// Delete deletes the given key (and related value) from the orederedMap. +// Delete deletes the given key (and related value) from the orderedMap. // It returns false if the key is not found. func (orderedMap *OrderedMap) Delete(key interface{}) bool { if _, valueExists := orderedMap.Get(key); !valueExists { diff --git a/packages/binary/datastructure/orderedmap/orderedmap_test.go b/packages/binary/datastructure/orderedmap/orderedmap_test.go index 72e3e71c46ad56250565a32f3eb5fc26f1fad09f..0b202a0878ec52a82dba784cb149d992c1fce03d 100644 --- a/packages/binary/datastructure/orderedmap/orderedmap_test.go +++ b/packages/binary/datastructure/orderedmap/orderedmap_test.go @@ -73,7 +73,7 @@ func TestSetGetDelete(t *testing.T) { assert.False(t, ok) // when deleting an existing element, we must get true, - // the elemente must be removed, and size decremented. + // the element must be removed, and size decremented. deleted := orderedMap.Delete("key") assert.True(t, deleted) value, ok = orderedMap.Get("key") diff --git a/packages/binary/messagelayer/messagerequester/messagerequester.go b/packages/binary/messagelayer/messagerequester/messagerequester.go index ce350f4bf79109cc13d4c405359aafeb4b329d23..5018520849e4a3a1b7beb0ff15626101e569059a 100644 --- a/packages/binary/messagelayer/messagerequester/messagerequester.go +++ b/packages/binary/messagelayer/messagerequester/messagerequester.go @@ -11,7 +11,7 @@ import ( ) var ( - // DefaultRequestWorkerCount defines the Default Request Worker Count of the message reqeuster. + // DefaultRequestWorkerCount defines the Default Request Worker Count of the message requester. DefaultRequestWorkerCount = runtime.GOMAXPROCS(0) ) diff --git a/packages/binary/messagelayer/tangle/messagemetadata.go b/packages/binary/messagelayer/tangle/messagemetadata.go index 21345fc61bad9b82c8961eff560fe05e138dc16b..e1abe276b1179fb296fa08136797191cb131ae70 100644 --- a/packages/binary/messagelayer/tangle/messagemetadata.go +++ b/packages/binary/messagelayer/tangle/messagemetadata.go @@ -105,7 +105,8 @@ func (messageMetadata *MessageMetadata) SetSolid(solid bool) (modified bool) { return } -func (messageMetadata *MessageMetadata) SoldificationTime() time.Time { +// SolidificationTime returns the time when the message was marked to be solid. +func (messageMetadata *MessageMetadata) SolidificationTime() time.Time { messageMetadata.solidificationTimeMutex.RLock() defer messageMetadata.solidificationTimeMutex.RUnlock() @@ -119,7 +120,7 @@ func (messageMetadata *MessageMetadata) ObjectStorageKey() []byte { func (messageMetadata *MessageMetadata) ObjectStorageValue() []byte { return marshalutil.New(). WriteTime(messageMetadata.receivedTime). - WriteTime(messageMetadata.SoldificationTime()). + WriteTime(messageMetadata.SolidificationTime()). WriteBool(messageMetadata.IsSolid()). Bytes() } diff --git a/packages/metrics/events.go b/packages/metrics/events.go index b2d7bbd2fc8220a25da6ee483f89766ce6699076..91d94c6b73e5beee4d088c2483eebcfd9c6e01e8 100644 --- a/packages/metrics/events.go +++ b/packages/metrics/events.go @@ -39,7 +39,7 @@ type QueryReceivedEvent struct { // QueryReplyErrorEvent is used to pass information through a QueryReplyError event. type QueryReplyErrorEvent struct { - // ID defines the ID on the queryied node. + // ID defines the ID on the queried node. ID string // OpinionCount defines the local FPC number of opinions requested within a failed query. OpinionCount int diff --git a/plugins/analysis/dashboard/fpc_conflict.go b/plugins/analysis/dashboard/fpc_conflict.go index 2dfd3c37b1b442cdfa787729b572e96370e34024..a7880b962f52a6a94e0e362f076a5dc80a181e04 100644 --- a/plugins/analysis/dashboard/fpc_conflict.go +++ b/plugins/analysis/dashboard/fpc_conflict.go @@ -38,7 +38,7 @@ func (c conflict) isFinalized() bool { return (count == len(c.NodesView)) } -// finalizedRatio returns the ratio of nodes that have finlized a given conflict. +// finalizedRatio returns the ratio of nodes that have finalized a given conflict. func (c conflict) finalizedRatio() float64 { if len(c.NodesView) == 0 { return 0 diff --git a/plugins/dashboard/explorer_routes.go b/plugins/dashboard/explorer_routes.go index a5a0d8a2f270ac20aedd970e74001ec054489ff2..e00e1e2ecd70f126f9b8434b8d68f4b4c16722a0 100644 --- a/plugins/dashboard/explorer_routes.go +++ b/plugins/dashboard/explorer_routes.go @@ -43,7 +43,7 @@ func createExplorerMessage(msg *message.Message) (*ExplorerMessage, error) { messageMetadata := cachedMessageMetadata.Unwrap() t := &ExplorerMessage{ ID: messageID.String(), - SolidificationTimestamp: messageMetadata.SoldificationTime().Unix(), + SolidificationTimestamp: messageMetadata.SolidificationTime().Unix(), IssuanceTimestamp: msg.IssuingTime().Unix(), IssuerPublicKey: msg.IssuerPublicKey().String(), Signature: msg.Signature().String(), @@ -60,7 +60,7 @@ func createExplorerMessage(msg *message.Message) (*ExplorerMessage, error) { // ExplorerAddress defines the struct of the ExplorerAddress. type ExplorerAddress struct { - // Messagess hold the list of *ExplorerMessage. + // Messages hold the list of *ExplorerMessage. Messages []*ExplorerMessage `json:"message"` } diff --git a/plugins/metrics/global_metrics.go b/plugins/metrics/global_metrics.go index 4eee1bf14f6af22b3053b5253c6ad4ce31cd018e..0a0ef13968431d42b13bdda64da79de318173658 100644 --- a/plugins/metrics/global_metrics.go +++ b/plugins/metrics/global_metrics.go @@ -24,14 +24,14 @@ type NodeInfo struct { } var ( - nodesMetrics = make(map[string]NodeInfo) - nodessMetricsMutex sync.RWMutex - networkDiameter atomic.Int32 + nodesMetrics = make(map[string]NodeInfo) + nodesMetricsMutex sync.RWMutex + networkDiameter atomic.Int32 ) var onMetricHeartbeatReceived = events.NewClosure(func(hb *packet.MetricHeartbeat) { - nodessMetricsMutex.Lock() - defer nodessMetricsMutex.Unlock() + nodesMetricsMutex.Lock() + defer nodesMetricsMutex.Unlock() nodesMetrics[shortNodeIDString(hb.OwnID)] = NodeInfo{ OS: hb.OS, Arch: hb.Arch, @@ -43,8 +43,8 @@ var onMetricHeartbeatReceived = events.NewClosure(func(hb *packet.MetricHeartbea // NodesMetrics returns info about the OS, arch, number of cpu cores, cpu load and memory usage. func NodesMetrics() map[string]NodeInfo { - nodessMetricsMutex.RLock() - defer nodessMetricsMutex.RUnlock() + nodesMetricsMutex.RLock() + defer nodesMetricsMutex.RUnlock() // create copy of the map var copy = make(map[string]NodeInfo) // manually copy content diff --git a/plugins/prometheus/autopeering.go b/plugins/prometheus/autopeering.go index bd4b743536de3063ab95c326bbf66023b99d6466..5d38aa8444c689f061dec4cce1360de8f1dbdac3 100644 --- a/plugins/prometheus/autopeering.go +++ b/plugins/prometheus/autopeering.go @@ -22,7 +22,7 @@ func registerAutopeeringMetrics() { avgNeighborConnectionLifeTime = prometheus.NewGauge(prometheus.GaugeOpts{ Name: "autopeering_avg_neighbor_connection_lifetime", - Help: "Autopeering avgerage neighbor connection lifetime.", + Help: "Autopeering average neighbor connection lifetime.", }) connectionsCount = prometheus.NewGauge(prometheus.GaugeOpts{ diff --git a/plugins/prometheus/process.go b/plugins/prometheus/process.go index eda4dfc201fc8d516b0e5bc15139ccd60fb0fe61..05ea6542aa97523b2f748fab3241f43dfae4fa50 100644 --- a/plugins/prometheus/process.go +++ b/plugins/prometheus/process.go @@ -23,10 +23,10 @@ func registerProcessMetrics() { registry.MustRegister(cpuUsage) registry.MustRegister(memUsageBytes) - addCollect(collectProcesskMetrics) + addCollect(collectProcessMetrics) } -func collectProcesskMetrics() { +func collectProcessMetrics() { cpuUsage.Set(float64(metrics.CPUUsage())) memUsageBytes.Set(float64(metrics.MemUsage())) } diff --git a/plugins/webapi/info/plugin.go b/plugins/webapi/info/plugin.go index 255343b62f108094e0ad774fc72d6c9c33dbcfea..8c2053d0fc90236802cca9ecc6821263b20b4019 100644 --- a/plugins/webapi/info/plugin.go +++ b/plugins/webapi/info/plugin.go @@ -63,7 +63,7 @@ func configure(_ *node.Plugin) { // "Graceful Shutdown", // "Logger" // ], -// "disabledlugins":[ +// "disabledplugins":[ // "RemoteLog", // "Spammer", // "WebAPI Auth" diff --git a/plugins/webapi/message/plugin.go b/plugins/webapi/message/plugin.go index 015a69e32b231f589f3200b798c8f6501f8b1d1b..c65b6c3e4409e2c15bc6d427896552157b25773b 100644 --- a/plugins/webapi/message/plugin.go +++ b/plugins/webapi/message/plugin.go @@ -72,7 +72,7 @@ func findMessageByID(c echo.Context) error { msgResp := Message{ Metadata: Metadata{ Solid: msgMetadata.IsSolid(), - SolidificationTime: msgMetadata.SoldificationTime().Unix(), + SolidificationTime: msgMetadata.SolidificationTime().Unix(), }, ID: msg.Id().String(), TrunkID: msg.TrunkId().String(), diff --git a/plugins/webapi/value/attachments/handler.go b/plugins/webapi/value/attachments/handler.go index a54d517efdb2c7ab43f82d92ff756ad15917bac9..973ec5e87f7ae01ba4621969e8677982b02db77d 100644 --- a/plugins/webapi/value/attachments/handler.go +++ b/plugins/webapi/value/attachments/handler.go @@ -28,7 +28,7 @@ func Handler(c echo.Context) error { } txn := utils.ParseTransaction(txnObj.Unwrap()) - // get attachements by txn id + // get attachments by txn id for _, attachmentObj := range valuetransfers.Tangle().Attachments(txnID) { defer attachmentObj.Release() if !attachmentObj.Exists() { @@ -56,7 +56,7 @@ func Handler(c echo.Context) error { return c.JSON(http.StatusOK, Response{Attachments: valueObjs}) } -// Response is the HTTP response from retreiving value objects. +// Response is the HTTP response from retrieving value objects. type Response struct { Attachments []ValueObject `json:"attachments,omitempty"` Error string `json:"error,omitempty"` diff --git a/plugins/webapi/value/gettransactionbyid/handler.go b/plugins/webapi/value/gettransactionbyid/handler.go index 0f8ebaaab66fbe85d26e502cfb9268fcc47ca1d6..769c9dda5ed8f4eaf68185679c3755f8cc90be9f 100644 --- a/plugins/webapi/value/gettransactionbyid/handler.go +++ b/plugins/webapi/value/gettransactionbyid/handler.go @@ -45,7 +45,7 @@ func Handler(c echo.Context) error { }) } -// Response is the HTTP response from retreiving transaction. +// Response is the HTTP response from retrieving transaction. type Response struct { Transaction utils.Transaction `json:"transaction,omitempty"` InclusionState utils.InclusionState `json:"inclusion_state,omitempty"` diff --git a/plugins/webapi/value/unspentoutputs/handler.go b/plugins/webapi/value/unspentoutputs/handler.go index 22dc4f0e37709055d0a0f6b77bd3d5c0480a18d6..1e0f08bb3447ce96ee372a36ae5721730318506a 100644 --- a/plugins/webapi/value/unspentoutputs/handler.go +++ b/plugins/webapi/value/unspentoutputs/handler.go @@ -79,7 +79,7 @@ type Request struct { Error string `json:"error,omitempty"` } -// Response is the HTTP response from retreiving value objects. +// Response is the HTTP response from retrieving value objects. type Response struct { UnspentOutputs []UnspentOutput `json:"unspent_outputs,omitempty"` Error string `json:"error,omitempty"` diff --git a/tools/integration-tests/tester/tests/common/common_test.go b/tools/integration-tests/tester/tests/common/common_test.go index 32f4fea32eea5fcbe1afd1b2ba9856fe258dbbf7..2d28acc16e304f0f680edf629fc39ae31069fabf 100644 --- a/tools/integration-tests/tester/tests/common/common_test.go +++ b/tools/integration-tests/tester/tests/common/common_test.go @@ -14,8 +14,8 @@ import ( // a node that joins later solidifies, whether it is desyned after a restart // and becomes synced again. func TestSynchronization(t *testing.T) { - initalPeers := 4 - n, err := f.CreateNetwork("common_TestSynchronization", initalPeers, 2) + initialPeers := 4 + n, err := f.CreateNetwork("common_TestSynchronization", initialPeers, 2) require.NoError(t, err) defer tests.ShutdownNetwork(t, n) @@ -37,7 +37,7 @@ func TestSynchronization(t *testing.T) { require.NoError(t, err) // 3. issue some messages on old peers so that new peer can solidify - ids = tests.SendDataMessagesOnRandomPeer(t, n.Peers()[:initalPeers], 10, ids) + ids = tests.SendDataMessagesOnRandomPeer(t, n.Peers()[:initialPeers], 10, ids) // wait for peer to solidify time.Sleep(15 * time.Second) @@ -66,7 +66,7 @@ func TestSynchronization(t *testing.T) { //assert.Falsef(t, resp.Synced, "Peer %s should be desynced but is synced!", newPeer.String()) // 8. issue some messages on old peers so that new peer can sync again - ids = tests.SendDataMessagesOnRandomPeer(t, n.Peers()[:initalPeers], 10, ids) + ids = tests.SendDataMessagesOnRandomPeer(t, n.Peers()[:initialPeers], 10, ids) // wait for peer to sync time.Sleep(10 * time.Second) diff --git a/tools/relay-checker/main.go b/tools/relay-checker/main.go index 92e1bb43f479d54c02c7aa473f7603b4026c7e6c..998fda5f212cca982397f988f0857039fefb0dcb 100644 --- a/tools/relay-checker/main.go +++ b/tools/relay-checker/main.go @@ -17,7 +17,7 @@ func testBroadcastData(api *client.GoShimmerAPI) (string, error) { return msgID, nil } -func testTargetGetMessagess(api *client.GoShimmerAPI, msgID string) error { +func testTargetGetMessages(api *client.GoShimmerAPI, msgID string) error { // query target node for broadcasted data if _, err := api.FindMessageByID([]string{msgID}); err != nil { return fmt.Errorf("querying the target node failed: %w", err) @@ -56,7 +56,7 @@ func main() { time.Sleep(time.Duration(cooldownTime) * time.Second) // query target node - err = testTargetGetMessagess(api, msgID) + err = testTargetGetMessages(api, msgID) if err != nil { fmt.Printf("%s\n", err) break