Skip to content

[KLC-1595] Change naming to Klever Blockchain#14

Merged
nickgs1337 merged 16 commits intomainfrom
KLC-1595-change-naming-to-klever-blockchain
Jul 2, 2025
Merged

[KLC-1595] Change naming to Klever Blockchain#14
nickgs1337 merged 16 commits intomainfrom
KLC-1595-change-naming-to-klever-blockchain

Conversation

@RomuloSiebra
Copy link
Copy Markdown

@RomuloSiebra RomuloSiebra commented Jun 12, 2025

Summary

Since the klv-bridge-eth-go is a fork from multiversx, the naming of variables/structs and logs, are from multiversx clients, with the change to klever node, it is required to update these names accordingly to reflect the node change.

The naming changes done follow a standard where:

  • multivesx -> kc
  • mx -> klv
  • esdt ->kda
  • mvx -> klv

In code comments, it was modified to Klever Blockchain

Summary by CodeRabbit

  • Refactor
    • Rebranded all references from "MultiversX" to "Klever Blockchain" or "KC" throughout the application, including user-facing documentation, configuration files, logs, and test cases.
    • Updated naming conventions, configuration sections, and address formats to align with Klever Blockchain standards.
    • Adjusted interface and struct names, method parameters, and error messages to reflect the new blockchain context.
  • Documentation
    • Updated documentation and templates to reference Klever Blockchain instead of MultiversX.
    • Revised API and README to reflect new project branding and contact information.
  • Chores
    • Updated Docker and workflow files to use new naming conventions and environment variables.
    • Adjusted test data and mock objects for compatibility with Klever Blockchain.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 12, 2025

Walkthrough

This update systematically transitions the entire codebase, documentation, tests, and configuration from supporting the MultiversX blockchain to supporting the Klever Blockchain (KC). All identifiers, comments, configuration keys, and logic referencing MultiversX or its abbreviations (e.g., "mvx", "erd") are replaced with Klever Blockchain equivalents (e.g., "kc", "klv"). This includes renaming types, interfaces, constants, method and function names, error variables, metrics, and configuration sections. Test suites, Docker and CI/CD files, and all supporting documentation are similarly updated to reflect the new blockchain context. The core logic, control flow, and error handling remain unchanged except for the systematic renaming and retargeting.

Changes

File(s) / Group Change Summary
Documentation & Issue Templates (README.md, .github/ISSUE_TEMPLATE/*, api/swagger/*) Replaced all references to MultiversX with Klever Blockchain; updated schema/entity names.
Configs & Docker (cmd/*/config.toml, docker/*, scCallsExecutor.Dockerfile) Updated section names, addresses, file paths, and comments from MultiversX to Klever Blockchain.
Core Logic (bridges/ethKC/, clients/, core/, factory/, p2p/, config/, executors/, parsers/) Renamed packages, types, interfaces, constants, methods, and variables from MultiversX to KC.
Integration & Unit Tests (integrationTests/*, clients/*_test.go, bridges/ethKC/*_test.go, etc.) Updated all test names, mocks, and data to reflect the KC context; no logic changes.
Stubs & Test Helpers (testsCommon/*) Renamed helper types, functions, and comments from MultiversX to KC/Klever.
Deleted/Added Files Deleted: bridges/ethMultiversX/constants.go, integrationTests/relayers/slowTests/startsFromMultiversxFlow.go; Added: bridges/ethKC/constants.go, integrationTests/relayers/slowTests/startsFromKcFlow.go
State Machine Steps (bridges/ethKC/steps/*) All step constants, identifiers, and logic updated from MultiversX to KC.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BridgeApp
    participant KCClient
    participant EthereumClient

    User->>BridgeApp: Initiate cross-chain transfer
    BridgeApp->>KCClient: Fetch KC batch/status
    KCClient-->>BridgeApp: Return batch/status
    BridgeApp->>EthereumClient: Check/execute batch on Ethereum
    EthereumClient-->>BridgeApp: Confirm execution
    BridgeApp->>KCClient: Update KC batch status
    KCClient-->>BridgeApp: Confirm status update
    BridgeApp-->>User: Notify transfer completion
Loading

Poem

🥕
From MultiversX to KC we leap,
With every name and constant deep.
Klever chains now bridge our way,
In code and docs, no more delay!
Tests and configs, all aligned anew,
A blockchain hop—our work is through!
🐇✨

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@RomuloSiebra RomuloSiebra marked this pull request as ready for review June 16, 2025 12:27
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

🔭 Outside diff range comments (13)
bridges/ethKc/steps/ethToKc/step04WaitForQuorum_test.go (1)

56-60: Assertion always passes – use assert.False for boolean

IsInterfaceNil() returns a bool; assert.NotNil will never fail for a non-pointer boolean.
Assert on the actual value instead:

-// Test IsInterfaceNil
-assert.NotNil(t, step.IsInterfaceNil())
+// Test IsInterfaceNil
+assert.False(t, step.IsInterfaceNil())
executors/kc/scCallsExecutor_test.go (1)

15-20: Duplicate import of the same package breaks compilation

github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address is imported twice
(line 17 without alias, line 18 with alias). Go forbids duplicate imports and the test file
will not compile.

Suggested fix:

-    "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address"
-    kleverAddress "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address"
+    kleverAddress "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address"

Then replace every occurrence of address. with kleverAddress. inside this file.

This change touches many lines, but is purely mechanical and avoids a hard build failure.

testsCommon/testKcCodec.go (1)

103-110: Length-sanity check is wrong – decoder panics on any valid payload

decodeCallData() compares numChars (the first 4-byte value) with len(buff) after those 4 bytes were already sliced off.
For a normal payload this can never be equal – the buffer still contains the function name, gas-limit, args, etc. The code therefore panics for every non-empty call-data.

-	buff, numChars, err := parsers.ExtractUint32(buff)
+	// totalLen is the size of the encoded call-data that follows this field
+	buff, totalLen, err := parsers.ExtractUint32(buff)
 	if err != nil {
 		panic(err)
 	}
-	if numChars != len(buff) {
-		panic("mismatch for len")
+	if int(totalLen) > len(buff) {
+		panic(fmt.Sprintf("declared length %d exceeds remaining buffer %d", totalLen, len(buff)))
 	}

The subsequent parsing should operate on buff[:totalLen] (and advance the pointer) to keep the decoder robust.
Please add a unit-test exercising a round-trip for a non-empty CallData instance – it currently fails.

testsCommon/addressGenerators.go (1)

18-26: Ignored constructor error may hide invalid addresses

address.NewAddressFromBytes returns an error; ignoring it risks propagating an invalid KC address into tests.

-	addr, _ := address.NewAddressFromBytes(buff)
+	addr, err := address.NewAddressFromBytes(buff)
+	if err != nil {
+		panic(err) // tests should fail loudly
+	}

Do the same in CreateRandomKcSCAddress.

api/swagger/swagger/openapi.yaml (1)

1-60: Swagger 2.0 + “components” = spec violation

You kept swagger: "2.0" but switched to OpenAPI-3 style sections (components, content, $ref: '#components/…').
This mix renders the spec invalid and will break code-gen / swagger-ui.

-swagger: "2.0"
+openapi: 3.0.3-components:
-  schemas:
+components:
+  schemas:

Either (1) upgrade fully to OpenAPI-3 or (2) revert to Swagger-2 keywords (definitions, responses.schema, etc.).

integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)

100-105: Potential deadlock: require.Nil before wg.Done

require.Nil invokes FailNow, which aborts the goroutine without reaching wg.Done, leaving wg.Wait() hanging forever.

- go func() {
-     err = relayer.Start()
-     log.LogIfError(err)
-     require.Nil(bridge, err)
-     wg.Done()
- }()
+ go func() {
+     defer wg.Done()
+     err := relayer.Start()
+     log.LogIfError(err)
+     assert.Nil(bridge, err) // assert is safe inside goroutines
+ }()

Switch to assert (non-fatal) or move wg.Done into a defer to avoid the latent deadlock.

executors/ethereum/migrationBatchCreator_test.go (1)

440-448: Duplicate branch – likely copy-paste typo

DecimalsCalled contains two identical checks for tkn2Erc20Address, the second one probably meant tkn3Erc20Address.

- if string(erc20Address.Bytes()) == string(tkn2Erc20Address) {
-     return 0, nil
- }
+ if string(erc20Address.Bytes()) == string(tkn3Erc20Address) {
+     return 0, nil
+ }

Without this fix tkn3 falls into the default branch and returns 0, which may hide decimals-handling bugs.

core/batchProcessor/batchProcessor_test.go (1)

52-68: assert.Equal will fail for []*big.Int – compare values, not pointer addresses

big.NewInt allocates a fresh pointer every call; therefore the two slices contain different pointer addresses even though the numeric values match.
assert.Equal (via reflect.DeepEqual) compares pointers, so these assertions will always fail.

Refactor to use value comparison, e.g.:

-assert.Equal(t, expectedAmounts, args.Amounts)
+for i, want := range expectedAmounts {
+    assert.Zero(t, want.Cmp(args.Amounts[i]), "amount mismatch at index %d", i)
+}

Do the same for expectedNonces.
Without this, the test suite will be red immediately after merge.

integrationTests/relayers/slowTests/framework/keys.go (1)

150-158: Ethereum-funding filter uses Klever key instead of Ethereum key

WalletsToFundOnEthereum skips entries where len(key.KlvSk)==0.
The presence of a Klever private key is irrelevant when deciding which wallets need ETH funding; the intended guard is usually the Ethereum key.

-        if len(key.KlvSk) == 0 {
+        if key.EthSK == nil {
             continue
         }
factory/ethKcBridgeComponents.go (1)

259-269: Production code left with TODOs that mask potential decoding bugs

Both // TODO: change decoder to use klever from string to hex comments signal that the addresses are still decoded with MultiversX assumptions.
If the byte layout / checksum differs, signatures or contract calls will silently revert at runtime.

Resolve the TODO before merging or guard the code with feature flags/tests so relayers do not start with invalid addresses.

clients/balanceValidator/balanceValidator.go (2)

60-99: Potential mismatch between Direction enum and switch cases

checkRequiredBalance switches on batchProcessor.Direction expecting FromKc and ToKc, yet only FromKc is visible in the current constants.
If ToKc is absent the default branch will always fire, returning ErrInvalidDirection.

Please verify the enum definition and add the missing constant or update the switch.


271-300: Endless loop risk when no executed batch is ever found

Both getTotalTransferAmountInPendingKlvBatches and its Ethereum counterpart iterate with an unbounded for { … } and monotonic batchID--/++.
If the chain returns an uninterrupted sequence of pending batches, the loop never exits.

Guard against runaway iterations, e.g.:

-for {
+maxIterations := 1_000_000
+for i := 0; i < maxIterations; i++ {
     ...
 }
+return nil, fmt.Errorf("safety stop hit while scanning pending batches")
testsCommon/bridge/bridgeExecutorStub.go (1)

420-427: CheckAvailableTokens neither increments the counter nor returns notImplemented

  1. Add the counter increment to stay coherent with the other stub methods.
  2. When the callback is not injected, return notImplemented instead of nil so that tests can detect missing expectations.
 func (stub *BridgeExecutorStub) CheckAvailableTokens(ctx context.Context, ethTokens []common.Address, kdaTokens [][]byte, amounts []*big.Int, direction batchProcessor.Direction) error {
+    stub.incrementFunctionCounter()
     if stub.CheckAvailableTokensCalled != nil {
         return stub.CheckAvailableTokensCalled(ctx, ethTokens, kdaTokens, amounts, direction)
     }
-    return nil
+    return notImplemented
 }
♻️ Duplicate comments (3)
integrationTests/relayers/slowTests/framework/tokensRegistry.go (1)

56-64: Ditto on kdaChainSpecificToken naming

Same mismatch here – align the parameter with the field.

integrationTests/relayers/ethToKc_test.go (1)

257-283: Same duplication pattern in the second test

The same AddBatch(batch) duplication appears here. Clean-up for consistency.

testsCommon/bridge/bridgeExecutorStub.go (1)

387-393: Symmetric issue in CheckEthereumClientAvailability

Mirror the fix applied to the KC counterpart for consistency and correct metrics.

🧹 Nitpick comments (87)
executors/kc/errors.go (1)

6-18: Nit: Align error message with variable name.

The message for errInvalidNumberOfResponseLines reads "invalid number of responses", which may mislead; consider updating it to "invalid number of response lines" for consistency.

clients/klever/proxy/interface.go (1)

11-11: Remove duplicate "blockchain"

The comment repeats "blockchain". Consider simplifying:

-// Proxy defines the behavior of a proxy able to serve Klever Blockchain blockchain requests
+// Proxy defines the behavior of a proxy able to serve Klever Blockchain requests
clients/klever/proxy/endpointProviders/proxyEndpointProvider.go (1)

11-11: Add trailing period in comment

Align with Go doc conventions by ending the sentence with a period:

-// proxyEndpointProvider is suitable to work with a Klever Blockchain Proxy
+// proxyEndpointProvider is suitable to work with a Klever Blockchain Proxy.
executors/kc/interface.go (1)

25-25: Terminate doc comment with a period

For consistency in Go documentation comments, append a period:

-// Codec defines the operations implemented by a Klever Blockchain codec
+// Codec defines the operations implemented by a Klever Blockchain codec.
clients/klever/proxy/endpointProviders/nodeEndpointProvider.go (1)

11-11: Add trailing period in comment

Ensure uniform doc style by ending with a period:

-// nodeEndpointProvider is suitable to work with a Klever Blockchain node (observer)
+// nodeEndpointProvider is suitable to work with a Klever Blockchain node (observer).
clients/klever/mappers/interface.go (1)

5-5: Fix duplicated word in comment.

The comment reads “Klever Blockchain blockchain”. Remove the redundant “blockchain” to improve clarity.

clients/klever/proxy/proxy.go (2)

32-33: Standardize naming in comment.

The comment uses “kc proxy” — consider updating to “Klever Blockchain proxy” or capitalize the abbreviation as “Kc proxy” to match project conventions.


45-46: Align comment with naming convention.

Similar to ArgsProxy, update “kc Proxy” to “Klever Blockchain proxy” or “Kc proxy” for consistency.

parsers/types.go (1)

41-48: Consider standardizing address case labels.

The output uses “Eth address” and “Klv address”. For consistency with other logs and outputs, consider using uppercase abbreviations (e.g., ETH address and KLV address) or full names (e.g., Ethereum address and Klever address).

README.md (2)

21-21: Grammar nit: adjust verb form

Change “considering to help out” to “considering helping out” for correct verb usage.

-Thank you for considering to help out with the source code!
+Thank you for considering helping out with the source code!

23-23: Grammar nit: refine “both ... as well as”

Use “and” after “both” instead of “as well as” for idiomatic phrasing.

-which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
+which can make both your efforts much lighter and our review and merge procedures quick and simple.
bridges/ethKc/errors.go (1)

1-1: Enforce Go package naming conventions.
The package name ethKc uses mixed case. Go style recommends all lowercase package names (e.g., ethkc) to avoid casing issues and adhere to standard conventions.

scCallsExecutor.Dockerfile (1)

22-22: Copy only the executable for leaner image.
Currently, the COPY --from=builder /kc/cmd/scCallsExecutor /kc copies the entire directory. Consider limiting this to the binary:

-COPY --from=builder /kc/cmd/scCallsExecutor /kc
+COPY --from=builder /kc/cmd/scCallsExecutor/scCallsExecutor /kc/

to reduce image size.

clients/klever/proxy/baseProxy.go (1)

18-18: Rebrand logger namespace invocation.
Updated the logger context from "mx-sdk-go/blockchain" to "klever-go-sdk/blockchain". However, the import path still points to github.com/multiversx/mx-chain-logger-go. Consider renaming or forking the logger package for Klever-specific branding if available.

bridges/ethKc/constants.go (1)

7-10: Export or document durationLimit to clarify its intent

Unlike InvalidActionID, durationLimit is unexported and lacks a comment.
If callers in other packages need this timeout, they cannot reference it, which may lead to duplicated literals.
Either export it (DurationLimit) or add a comment explaining that it is intentionally package-private.

-const durationLimit = time.Second
+// durationLimit defines the maximum time allowed for on-chain polling operations.
+// It is package-private because no external package should rely on it directly.
+const durationLimit = time.Second
bridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go (1)

15-27: Context parameter is ignored – consider wiring it through

Execute receives a context.Context but discards it (_).
If downstream methods (e.g. SignTransferOnEthereum) ever need cancellation or deadlines, the information is lost.

-func (step *signProposedTransferStep) Execute(_ context.Context) core.StepIdentifier {
+func (step *signProposedTransferStep) Execute(ctx context.Context) core.StepIdentifier {
 ...
-    err := step.bridge.SignTransferOnEthereum()
+    // propagate ctx once bridge APIs accept it
+    err := step.bridge.SignTransferOnEthereum() // TODO: accept ctx

Even if the current bridge API doesn’t accept a context, keeping the param name (ctx) documents intent and eases future refactors.

clients/klever/proxy/proxy_test.go (1)

459-460: Large in-line JSON literals hamper readability

The two ~600-character JSON literals make the test hard to scan.
Consider extracting them into helper functions or embedding testdata files to reduce noise and improve maintainability.

executors/kc/filters/pendingOperationFilter_test.go (1)

261-262: Rename the sub-test for clarity

The label "kda address" no longer matches the content (we deal with KLV addresses here).
Consider updating to avoid confusion in future test reports.

-t.Run("kda address", func(t *testing.T) {
+t.Run("klv address", func(t *testing.T) {
cmd/scCallsExecutor/flags.go (2)

72-75: Consider defining a sane default or env-var fallback for --network-address
The Usage text now points to a Klever test-net node, but the flag still has no default value. Supplying either:

  1. a default pointing to the public test-net gateway, or
  2. the ability to read KLV_NETWORK_ADDRESS from the environment

would spare operators from always having to provide the flag manually.


81-85: Tighten wording and avoid comment/Usage duplication

Both the line comment and the Usage string repeat identical information and contain the singular “transaction”. A concise phrasing removes the duplication and fixes the grammar.

-// privateKeyFile is the Klever Blockchain private key file used to issue transaction for the SC calls
+// Path to the PEM file holding the Klever Blockchain private key used to sign SC-call transactions

 ...
-Usage: "The Klever Blockchain private key file used to issue transaction for the SC calls",
+Usage: "Path to the PEM file that holds the Klever private key used to sign SC-call transactions",
p2p/interface.go (1)

27-28: Minor wording & lingering dependency note

  1. English article should be “a Klever Blockchain role provider”, not “an Klever…”.
  2. While the interface was renamed to KcRoleProvider, the file still imports multiversx/mx-chain-core-go. Make sure the long-term plan is to phase out this dependency to avoid mixed terminology and potential incompatibilities.
bridges/ethKc/steps/ethToKc/step05PerformActionID.go (1)

17-22: Log message mismatch – should reference “performed”, not “proposed”

The check is WasActionPerformedOnKc, but the error text still says “proposed”.

- step.bridge.PrintInfo(logger.LogError, "error determining if the action ID was proposed or not",
+ step.bridge.PrintInfo(logger.LogError, "error determining if the action ID was performed or not",
executors/kc/scCallsExecutor_test.go (1)

594-606: Minor nit – typo in comment

// only the second pending operation gor through the filter
→ “goes through the filter”

Not blocking, but worth a quick touch-up on your next sweep.

testsCommon/testKcCodec.go (2)

16-29: Top-level marker hard-codes “data present”

EncodeCallDataWithLenAndMarker() always prefixes bridgeCore.DataPresentProtocolMarker, even if the caller intends to convey missing data (e.g. an empty CallData). This makes it impossible to encode the “missing data” variant.

Consider:

-	result = append(result, bridgeCore.DataPresentProtocolMarker) // marker
+	marker := bridgeCore.DataPresentProtocolMarker
+	if callData.Type == bridgeCore.MissingDataProtocolMarker {
+		marker = bridgeCore.MissingDataProtocolMarker
+	}
+	result = append(result, marker)

At minimum, document that the helper only supports the “data present” scenario.


63-81: Inefficient buffer handling – drop the 1 MB pre-allocation

All three helpers (EncodeCallData*, encodeArgs) pre-allocate 1 MiB. For test utilities this wastes memory and obscures intent.

-initialAlloc := 1024 * 1024 // 1MB initial buffer
-result := make([]byte, 0, initialAlloc)
+var result []byte

If you want to avoid reallocations, use bytes.Buffer with Grow() or pick a modest guess (e.g. 128 B).

bridges/ethKc/steps/kcToEth/stepsFactory.go (2)

6-8: Left-over MultiversX dependency

While the file was renamed to kcToEth, it still imports
github.com/multiversx/mx-chain-core-go/core/check.
If the intention is a full re-branding, consider vendoring or mirroring the tiny check.IfNil helper to remove the residual dependency.

Not blocking, just a branding consistency note.


60-60: Error wrapping already adds context – avoid duplicated wording

fmt.Errorf("%w for identifier '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier())

The wrapped error already explains the problem; the suffix duplicates it.
Prefer:

- return nil, fmt.Errorf("%w for identifier '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier())
+ return nil, fmt.Errorf("%w: '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier())
testsCommon/addressGenerators.go (1)

28-37: Smart-contract address generator: magic constants deserve a comment

firstPart := append(make([]byte, 8), []byte{5, 0}...) silently encodes the SC prefix.
Add a short comment or constant (scPrefix) explaining the 0x0500 meaning to future readers.

cmd/migration/main.go (1)

157-165: Use un-exported identifiers for local vars

argsKLVClientDataGetter and KLVDataGetter start with an upper-case letter, which makes the identifiers exported, even though they are scoped only within createInternalComponentsWithBatchCreator. Most linters (revive, golint) will flag this as a style issue.

-	argsKLVClientDataGetter := klever.ArgsKLVClientDataGetter{
+	argsKlvClientDataGetter := klever.ArgsKLVClientDataGetter{
  	...
-	KLVDataGetter, err := klever.NewKLVClientDataGetter(argsKLVClientDataGetter)
+	klvDataGetter, err := klever.NewKLVClientDataGetter(argsKlvClientDataGetter)
  	...
-		KlvDataGetter:        KLVDataGetter,
+		KlvDataGetter:        klvDataGetter,

Renaming avoids accidental export and keeps the codebase consistent with standard Go naming conventions.

Also applies to: 201-207

clients/klever/klvClientDataGetter.go (1)

48-49: Comment refers to non-existent identifiers

The docstring mentions ArgsklvClientDataGetter and NewklvClientDataGetter, whereas the actual symbols are ArgsKLVClientDataGetter and NewKLVClientDataGetter.

-// ArgsklvClientDataGetter is the arguments DTO used in the NewklvClientDataGetter constructor
+// ArgsKLVClientDataGetter is the arguments DTO used in the NewKLVClientDataGetter constructor

Keeping comments in sync with code prevents confusion and helps tooling that parses documentation.

api/swagger/swagger/openapi.yaml (1)

40-41: Enum casing inconsistency

KleverBlockchainToEth / EthToKleverBlockchain use PascalCase while klever-client / eth-client use kebab-case.
Clients doing strict enum validation may fail. Align casing across all values.

bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (1)

121-123: Constant cast is redundant

ProposingSetStatusOnKc is already a core.StepIdentifier (type alias). The extra cast is unnecessary:

-expectedStep := bridgeCore.StepIdentifier(ProposingSetStatusOnKc)
+expectedStep := ProposingSetStatusOnKc
bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)

6-9: Left-over MultiversX logger import

While the business logic was rebranded, the logger package still points to github.com/multiversx/mx-chain-logger-go.
If Klever provides its own fork, consider switching; otherwise leave as-is and document the dependency.

clients/klever/mappers/mappers_test.go (1)

46-99: Minor semantic nit – argument naming

Several test invocations pass a byte slice labelled "klvAddress" where the mapper expects a token-id (ticker).
The label is harmless for the test but could confuse future readers – consider renaming the literal to "tokenId" for clarity.

integrationTests/mock/tokensRegistryMock.go (2)

27-31: Misspelling in log/panic messages

"tiker""ticker" appears twice. Small but worth fixing for grep-ability.

- panic("tiker for erc20 address " + erc20Address.String() + " not found")
+ panic("ticker for erc20 address " + erc20Address.String() + " not found")

44-57: Still not goroutine-safe — add mutex if future concurrency is expected

Comment already states “not concurrent safe”. If this mock ever gets reused in parallel tests, race conditions will bite.
Wrapping the maps with a sync.RWMutex is trivial and future-proof.

bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)

7-7: Redundant alias – simplify import

ethKc is already the package name; adding an explicit alias with the same spelling is noise and may confuse linters.

-	ethKc "github.com/klever-io/klv-bridge-eth-go/bridges/ethKc"
+	"github.com/klever-io/klv-bridge-eth-go/bridges/ethKc"
bridges/ethKc/steps/ethToKc/step01GetPending.go (1)

18-61: Retry counter reset only for Kc – is Ethereum side intentional?

ResetRetriesCountOnKc() is invoked, but the symmetric Ethereum retry counter (if any) is untouched.
If the intention is to clear all retry state when a new loop starts, add an Ethereum reset; otherwise document the asymmetry.

config/config.go (1)

164-166: Doc-comment uses a different struct name than the declaration

// KcGasMapConfig ... documents a struct that does not exist – the actual type that follows is KleverGasMapConfig.
This will break godoc / IDE navigation and is an easy source of confusion during later renames.

-// KcGasMapConfig represents the gas limits for Klever Blockchain operations
+// KleverGasMapConfig represents the gas limits for Klever Blockchain operations
integrationTests/relayers/slowTests/common.go (1)

56-58: Token-balance helpers still use the KDA prefix

Throughout the test helpers the new standard is Klv / Kc, yet fields such as KDASafeExtraBalance and inline comments still talk about “kda”.
For the sake of consistency (and grep-ability) consider switching these identifiers to KlvSafeExtraBalance.

No functional impact, but tightening naming early prevents drift.

Also applies to: 98-100, 140-142, 182-184

clients/klever/mappers/kcToErc20.go (1)

27-29: Comment contradicts the implementation

ConvertToken calls GetERC20AddressForTokenId, i.e. it maps KLV token-ID ➜ ERC-20 address.
The comment claims the opposite.

-// ConvertToken will return klv token id given a specific erc20 address
+// ConvertToken returns the ERC-20 address corresponding to the supplied KLV token-ID.
integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go (1)

15-18: Variable names no longer match the direction of transfer

kdaToEthDone is updated in the Kc ➜ Eth branch (SendFromKcToEthereum / IsTransferDoneFromKc).
To avoid mental mapping errors, rename the flag to kcToEthDone (or klvToEthDone) and update its usages.

-	kdaToEthDone bool
+	kcToEthDone bool
...
-	if !flow.kdaToEthDone && isTransferDoneFromKc {
-		flow.kdaToEthDone = true
+	if !flow.kcToEthDone && isTransferDoneFromKc {
+		flow.kcToEthDone = true

Also applies to: 41-45

p2p/broadcaster.go (1)

28-38: Minor naming drift between Args and struct field

Constructor arg is KcRoleProvider while the internal field is kleverRoleProvider.
Although harmless, using the same prefix (“kc”) everywhere eases grepping and reduces room for future copy-paste errors.

Not blocking, just consider:

-    kleverRoleProvider KcRoleProvider
+    kcRoleProvider KcRoleProvider

Also applies to: 44-48, 105-107, 155-157

clients/klever/mappers/erc20ToKc.go (1)

12-29: Optional: consider exporting the mapper type for reuse

erc20ToKc is currently unexported, while the constructor NewErc20ToKcMapper is exported.
If any external packages need to assert the concrete type (e.g. in tests), exporting the struct (Erc20ToKc) will avoid go vet warnings about returning unexported concrete types.

-type erc20ToKc struct {
+type Erc20ToKc struct {

Not critical, purely a style / usability choice.

bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go (2)

76-82: Comment / name mismatch – very minor

The inner test case title still says “SigningProposedSetStatusOnKc” but the constant used was already correct.
Consider aligning the description text for clarity during test failure output; code logic itself is sound.


110-118: Same nit – update description

Heading mentions SigningProposedTransferOnKc but expectation is SigningProposedSetStatusOnKc.
Purely cosmetic, but fixing avoids confusion when reading test results.

bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go (2)

6-9: Use KC-branded logger dependency for consistency

All multiversx identifiers are being removed, yet we still pull
github.com/multiversx/mx-chain-logger-go.
If Klever has its own fork/package, switch to it; otherwise add a TODO explaining why MultiversX’ logger remains.


25-27: Avoid logging a possibly-nil err

If WasTransferProposedOnKc returns (false, nil) the second log prints
"error", <nil>, which is confusing. Emit the message only when err != nil.

- step.bridge.PrintInfo(logger.LogError, "error determining if the batch was proposed or not on Kc",
-     "batch ID", batch.ID, "error", err)
+ if err != nil {
+     step.bridge.PrintInfo(logger.LogError, "error determining if the batch was proposed or not on Kc",
+         "batch ID", batch.ID, "error", err)
+ }
bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go (2)

6-10: Logger import still references MultiversX

Same remark as in step02: consider migrating to a Klever logger package to complete the re-branding.


30-33: Do not log err when it is guaranteed to be nil

err comes from the previous call and is nil if we reached the invalid-ID branch.
Logging it adds noise; drop the key or assign a meaningful value.

- step.bridge.PrintInfo(logger.LogError, "contract error, got invalid action ID",
-     "batch ID", batch.ID, "error", err, "action ID", actionID)
+ step.bridge.PrintInfo(logger.LogError, "contract error, got invalid action ID",
+     "batch ID", batch.ID, "action ID", actionID)
bridges/ethKc/steps/kcToEth/constants.go (2)

16-18: Typo: “confirmating” → “confirmation”

- WaitingTransferConfirmation = "wait transfer confirmating"
+ WaitingTransferConfirmation = "wait transfer confirmation"

22-24: Typo: “idetifier” → “identifier”

- // ProposingSetStatusOnKc is the step idetifier for proposing set status action on Kc
+ // ProposingSetStatusOnKc is the step identifier for proposing set status action on Kc
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go (2)

46-48: Incorrect log message – refers to “transfer” instead of “set status”

- step.bridge.PrintInfo(logger.LogError, "error proposing transfer on Kc",
+ step.bridge.PrintInfo(logger.LogError, "error proposing set status on Kc",

6-9: MultiversX logger import

Same branding concern as previous files – consider moving to a Klever-named logger.

clients/ethereum/client.go (2)

204-206: Comment & identifier drift (Klv vs Kc vs kda)

The comment says “Klv”, the receiver is an Ethereum client, and the parameter below is named kdaBatchID.
Pick ONE canonical acronym (preferably the same you decided above) to avoid cognitive overhead.


242-245: Rename argument for clarity

kdaBatchID is passed straight to WasBatchExecuted; if this is indeed a batch id on Klever, prefer kcBatchID (or whatever common acronym you settle on) for uniformity.

executors/kc/filters/pendingOperationFilter.go (3)

79-98: Redundant stringify-lowercase cycle – consider trimming once

Every parseList call lower-cases and trims again in the helper. Doing it here once is extra work and creates two slightly different code paths to keep in sync. Removing the pre-loop item = strings.ToLower(item) from parseList is the leaner spot-fix.


134-142: Missing validation for duplicate entries

checkList validates syntax but silently accepts duplicates.
Having the same KLV address twice in AllowedKlvAddresses or DeniedKlvAddresses serves no purpose and hides operator mistakes.
Quick win: keep a map[string]struct{} inside checkList and raise on repeats.


162-165: checkKlvItemValid loses HRP / checksum feedback

address.NewAddress(item) returns an error but does not say why the address is invalid (length? HRP? checksum?). Enhancing the wrapped error with context will help ops debug bad configs:

-	_, errNewAddr := address.NewAddress(item)
-	return errNewAddr
+	if _, err := address.NewAddress(item); err != nil {
+		return fmt.Errorf("invalid KLV address %q: %w", item, err)
+	}
+	return nil
integrationTests/relayers/slowTests/framework/tokensRegistry.go (2)

35-37: Spelling drift between Ticker and DisplayName

KlvChainSpecificTokenTicker receives params.KlvChainSpecificTokenDisplayName.
Either the field or the param name is off – pick one noun and stick with it to avoid confusion downstream in JSON marshaling & assertions.


45-53: Inconsistent prefix: kdaUniversalToken vs KlvUniversalToken

The API now mixes kda (function parameter) with Klv (field). For searchability and consistency favor one acronym:

-func (registry *tokensRegistry) RegisterUniversalToken(abstractTokenIdentifier string, kdaUniversalToken string) {
+func (registry *tokensRegistry) RegisterUniversalToken(abstractTokenIdentifier string, klvUniversalToken string) {
...
-	data.KlvUniversalToken = kdaUniversalToken
+	data.KlvUniversalToken = klvUniversalToken
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)

466-475: SendFromEthereumToKc duplicates loop logic – extract helper?

SendFromEthereumToKc and CreateBatchOnEthereum now share identical looping code. Consider keeping only one and calling it from the other to avoid future divergence.

parsers/kcCodec.go (1)

158-182: Receiver pointer vs value

func (codec *KcCodec) ExtractGasLimitFromRawCallData and the other methods use a value receiver; any future state you add won’t propagate. Probably fine today, but switching to *KcCodec now costs nothing and avoids surprises.

integrationTests/relayers/slowTests/startsFromKcFlow.go (2)

15-17: Variable naming: kdaToEthDone vs “KLV” / “KC”

The struct mixes ethToKlvDone with kdaToEthDone. Using three different abbreviations (klv, kda, kc) in the same file is easy to slip on during debugging. Rename to klvToEthDone for symmetry.


31-44: Missing context cancellation path

After the SendFromEthereumToKc kick-off, the test may hang indefinitely if the transfer never finalises. Consider adding a context with timeout to avoid endless CI runs.

bridges/ethKc/steps/kcToEth/step01GetPending_test.go (1)

86-95: Duplicate / misleading test title

Both this t.Run block and the one at lines 71-78 are named "error on WasTransferPerformedOnEthereum", yet this block is actually exercising an error returned by CheckAvailableTokens.
Rename the description to avoid confusion and to keep go test -run filters usable.

- t.Run("error on WasTransferPerformedOnEthereum", func(t *testing.T) {
+ t.Run("error on CheckAvailableTokens", func(t *testing.T) {
integrationTests/relayers/slowTests/framework/keys.go (1)

204-210: Unencrypted PEM export may leak private keys

SaveKlvKey writes raw hex-encoded secret keys directly into PEM blocks without any encryption or pass-phrase.
Even in test utilities, consider at least documenting the risk or using EncryptPEMBlock when the file is intended to be reused outside CI.

bridges/ethKc/steps/kcToEth/semiIntegrated_test.go (1)

311-314: Hard-coded string compared against typed constant

Comparing stepThatErrors (type bridgeCore.StepIdentifier) with the untyped string literal "SignActionOnKc" works but is brittle.
Prefer comparing against the previously declared constant signActionOnKc to avoid typos and keep refactors mechanical.

- if stepThatErrors == "SignActionOnKc" {
+ if stepThatErrors == signActionOnKc {
core/batchProcessor/batchProcessor.go (2)

30-32: Small perf win: pre-allocate slices

arg := &ArgListsBatch{ Direction: FromKc } is followed by multiple append calls in a loop.
Consider sizing the slices up-front to avoid repeated reallocations – e.g.:

-arg := &ArgListsBatch{ Direction: FromKc }
+arg := &ArgListsBatch{
+  Direction:  FromKc,
+  EthTokens:  make([]common.Address, 0, len(batch.Deposits)),
+  Recipients: make([]common.Address, 0, len(batch.Deposits)),
+  KdaTokenBytes: make([][]byte, 0, len(batch.Deposits)),
+  Amounts:   make([]*big.Int, 0, len(batch.Deposits)),
+  Nonces:    make([]*big.Int, 0, len(batch.Deposits)),
+}

56-58: Typo in comment

-// The transfer is from Ehtereum to Klever Blockchain
+// The transfer is from Ethereum to Klever Blockchain
bridges/ethKc/steps/kcToEth/step01GetPending.go (1)

6-10: Logger import still points to MultiversX repo

Even though only the previous line changed, note that the logger path is still
github.com/multiversx/mx-chain-logger-go.
If Klever maintains its own fork/package name, update accordingly to avoid a
transitive dependency on the old organisation.

integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go (1)

267-288: Prefer consistent abbreviations – KDA vs Klv

Inside createBadToken the struct now mixes Klv... fields with
KDASafeExtraBalance. Consider aligning to one prefix (Klv) to avoid cognitive
overhead.

executors/ethereum/migrationBatchCreator.go (1)

23-32: Field name drifts from new terminology

Internal field is called kdaDataGetter but the interface is KlvDataGetter.
Renaming the variable will improve readability:

-type migrationBatchCreator struct {
-    kdaDataGetter        KlvDataGetter
+type migrationBatchCreator struct {
+    klvDataGetter        KlvDataGetter

(and update usages).

integrationTests/relayers/slowTests/framework/types.go (1)

41-46: Struct field naming drift

All new fields were renamed with Klv prefixes, but HasChainSpecificToken (l.24) kept the old generic name.
For searchability and grep-based tooling stick to the same prefix, e.g. HasKlvChainSpecificToken.

factory/ethKcBridgeComponents.go (2)

116-117: Public constructor comment and name are out-of-sync

The doc-comment says NewethKleverBridgeComponents (lower-case “eth”), the exported function is NewEthKleverBridgeComponents.

Doc-comments must start with the exact identifier to satisfy golint and IDE quick-docs.

-// NewethKleverBridgeComponents creates a new eth-kc bridge components holder
+// NewEthKleverBridgeComponents creates a new eth-kc bridge components holder

665-669: Possible nil-pointer in balance validator creation

components.kcClient and components.ethClient are injected unconditionally; if either previous factory step failed and returned nil without error (e.g. due to config gating) this will panic here.
Consider early-returning if either client is nil.

integrationTests/relayers/slowTests/framework/address.go (2)

20-27: Local variable shadows imported package address

Inside NewKlvAddressFromBytes you create

address := &KlvAddress{ ... }

This shadows the imported address package for the remainder of the function, hurting readability.

-	address := &KlvAddress{
+	klvAddr := &KlvAddress{

and return klvAddr.


50-67: Receiver name shadows package as well

Methods use (address *KlvAddress) which again hides the imported package for the whole method body.
Use a short receiver (ka, a, etc.) to avoid confusion:

-func (address *KlvAddress) Bytes() []byte {
-    return address.bytes
+func (ka *KlvAddress) Bytes() []byte {
+    return ka.bytes
integrationTests/relayers/slowTests/framework/testSetup.go (1)

181-188: Atomic counter increment may overflow uint32 in long test suites

numScCallsInTest is uint32. A large fuzz run could silently wrap after 4 billion calls.
Use uint64 to be future-proof.

clients/balanceValidator/balanceValidator_test.go (1)

1375-1403: Duplicated magic slice kdaToken inside helper mutates global

applyDummyFromKlvDepositsToBatch always injects the global kdaToken even when the caller passes a different slice in cfg.kdaToken. Use the value from cfg instead to reflect the scenario under test.

-SourceTokenBytes: kdaToken,
+SourceTokenBytes: cfg.kdaToken,
integrationTests/relayers/ethToKc_test.go (1)

82-100: Duplicate AddBatch() calls can hide test intent

ethereumChainMock.AddBatch(batch) is invoked twice (lines 82 and 99).
Although idempotent in the current mock, duplicating calls:

  • Inflates the mock’s internal counter – some assertions may later rely on the exact call-count.
  • Obscures the intended chronology (before vs. after deposits).

Consider removing the second call unless you really need two identical entries.

-ethereumChainMock.AddBatch(batch)
...
-ethereumChainMock.AddBatch(batch) // duplicate
bridges/ethKc/steps/ethToKc/semiIntegrated_test.go (1)

255-266: stepsThatCanError slice contains duplicates

wasTransferProposedOnKc appears twice (260, 261). The duplicate adds no value and makes the intent of the test less clear.

-        wasTransferProposedOnKc,
-        proposeTransferOnKc,
-        wasTransferProposedOnKc,   // duplicate
+        wasTransferProposedOnKc,
+        proposeTransferOnKc,
bridges/ethKc/bridgeExecutor_test.go (1)

181-203: Assertion counters seem brittle

All counters are hard-coded to 4. When the step list changes these tests will silently become wrong.
Consider deriving the expected counter from numSteps or the executor’s step table to reduce maintenance overhead.

testsCommon/bridge/bridgeExecutorStub.go (3)

14-15: Logger import still references MultiversX package

The re-branding effort removes “multiversx” from identifiers, yet the logger import is still

logger "github.com/multiversx/mx-chain-logger-go"

Consider switching to an equivalent Klever-branded fork (if one exists) or, at minimum, add a TODO explaining why the original package is intentionally kept.


23-60: Field names updated – 👍 but doc-strings lag behind

The struct fields were consistently renamed (…OnKcCalled, etc.) – good job.
However, many godoc comments above the methods still start with the old “// …” pattern that doesn’t match the new identifiers (e.g. // GetBatchFromKc -). Consider updating the comment summaries to keep IDE symbol search in sync.


414-417: Use read lock in GetFunctionCounter

The method only reads the map; using RLock reduces contention.

- stub.mutExecutor.Lock()
- defer stub.mutExecutor.Unlock()
+ stub.mutExecutor.RLock()
+ defer stub.mutExecutor.RUnlock()
executors/ethereum/errors.go (1)

7-7: Inconsistent capitalization of proper noun in error message

Proper nouns (e.g., “Ethereum” in "nil Ethereum chain wrapper") are capitalized in other errors. To stay consistent, capitalize “Klever Blockchain” here:

-var errNilKlvDataGetter = errors.New("nil klever blockchain data getter")
+var errNilKlvDataGetter = errors.New("nil Klever Blockchain data getter")

Please verify that other error messages referring to Klever/KLV follow the same capitalization.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88eba0c and 099af2d.

📒 Files selected for processing (148)
  • .github/ISSUE_TEMPLATE/bug-report.md (1 hunks)
  • .github/ISSUE_TEMPLATE/feature.md (1 hunks)
  • .github/ISSUE_TEMPLATE/question.md (1 hunks)
  • .github/workflows/create_release.yml (1 hunks)
  • README.md (3 hunks)
  • api/swagger/README.md (1 hunks)
  • api/swagger/swagger/openapi.yaml (3 hunks)
  • bridges/ethKc/bridgeExecutor.go (23 hunks)
  • bridges/ethKc/bridgeExecutor_test.go (53 hunks)
  • bridges/ethKc/constants.go (1 hunks)
  • bridges/ethKc/converters.go (1 hunks)
  • bridges/ethKc/errors.go (2 hunks)
  • bridges/ethKc/interface.go (4 hunks)
  • bridges/ethKc/signaturesHolder.go (1 hunks)
  • bridges/ethKc/signaturesHolder_test.go (1 hunks)
  • bridges/ethKc/steps/ethToKc/constants.go (1 hunks)
  • bridges/ethKc/steps/ethToKc/semiIntegrated_test.go (7 hunks)
  • bridges/ethKc/steps/ethToKc/step01GetPending.go (4 hunks)
  • bridges/ethKc/steps/ethToKc/step01GetPending_test.go (9 hunks)
  • bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go (2 hunks)
  • bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go (7 hunks)
  • bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go (4 hunks)
  • bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go (8 hunks)
  • bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go (2 hunks)
  • bridges/ethKc/steps/ethToKc/step04WaitForQuorum_test.go (5 hunks)
  • bridges/ethKc/steps/ethToKc/step05PerformActionID.go (3 hunks)
  • bridges/ethKc/steps/ethToKc/step05PerformActionID_test.go (6 hunks)
  • bridges/ethKc/steps/ethToKc/stepsFactory.go (2 hunks)
  • bridges/ethKc/steps/ethToKc/stepsFactory_test.go (2 hunks)
  • bridges/ethKc/steps/interface.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/constants.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/semiIntegrated_test.go (7 hunks)
  • bridges/ethKc/steps/kcToEth/step01GetPending.go (4 hunks)
  • bridges/ethKc/steps/kcToEth/step01GetPending_test.go (9 hunks)
  • bridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer_test.go (1 hunks)
  • bridges/ethKc/steps/kcToEth/step04PerformTransfer.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go (3 hunks)
  • bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go (1 hunks)
  • bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation_test.go (1 hunks)
  • bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (8 hunks)
  • bridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go (8 hunks)
  • bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (8 hunks)
  • bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus_test.go (6 hunks)
  • bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/step10PerformSetStatus_test.go (7 hunks)
  • bridges/ethKc/steps/kcToEth/stepsFactory.go (2 hunks)
  • bridges/ethKc/steps/kcToEth/stepsFactory_test.go (2 hunks)
  • bridges/ethMultiversX/constants.go (0 hunks)
  • clients/balanceValidator/balanceValidator.go (11 hunks)
  • clients/balanceValidator/balanceValidator_test.go (25 hunks)
  • clients/balanceValidator/errors.go (1 hunks)
  • clients/balanceValidator/interface.go (2 hunks)
  • clients/ethereum/client.go (3 hunks)
  • clients/ethereum/client_test.go (7 hunks)
  • clients/ethereum/wrappers/ethereumChainWrapper_test.go (1 hunks)
  • clients/klever/client.go (3 hunks)
  • clients/klever/client_test.go (2 hunks)
  • clients/klever/errors.go (1 hunks)
  • clients/klever/klvClientDataGetter.go (2 hunks)
  • clients/klever/klvClientDataGetter_test.go (29 hunks)
  • clients/klever/mappers/erc20ToKc.go (2 hunks)
  • clients/klever/mappers/interface.go (1 hunks)
  • clients/klever/mappers/kcToErc20.go (2 hunks)
  • clients/klever/mappers/mappers_test.go (2 hunks)
  • clients/klever/proxy/baseProxy.go (2 hunks)
  • clients/klever/proxy/endpointProviders/nodeEndpointProvider.go (1 hunks)
  • clients/klever/proxy/endpointProviders/proxyEndpointProvider.go (1 hunks)
  • clients/klever/proxy/interface.go (1 hunks)
  • clients/klever/proxy/proxy.go (2 hunks)
  • clients/klever/proxy/proxy_test.go (1 hunks)
  • cmd/bridge/config/config.toml (1 hunks)
  • cmd/bridge/main.go (5 hunks)
  • cmd/migration/config/config-mainnet-bsc.toml (1 hunks)
  • cmd/migration/config/config-mainnet-eth.toml (1 hunks)
  • cmd/migration/config/config.toml (1 hunks)
  • cmd/migration/main.go (3 hunks)
  • cmd/scCallsExecutor/config/config.toml (2 hunks)
  • cmd/scCallsExecutor/flags.go (1 hunks)
  • cmd/scCallsExecutor/main.go (2 hunks)
  • config/config.go (2 hunks)
  • config/tomlConfigs_test.go (13 hunks)
  • core/batchProcessor/batchProcessor.go (3 hunks)
  • core/batchProcessor/batchProcessor_test.go (6 hunks)
  • core/constants.go (2 hunks)
  • docker/scCallsExecutor-docker-compose.yml (1 hunks)
  • executors/ethereum/bridgeV2Wrappers/ethereumChainWrapper_test.go (1 hunks)
  • executors/ethereum/errors.go (1 hunks)
  • executors/ethereum/interface.go (1 hunks)
  • executors/ethereum/migrationBatchCreator.go (5 hunks)
  • executors/ethereum/migrationBatchCreator_test.go (7 hunks)
  • executors/kc/errors.go (1 hunks)
  • executors/kc/filters/pendingOperationFilter.go (8 hunks)
  • executors/kc/filters/pendingOperationFilter_test.go (7 hunks)
  • executors/kc/interface.go (2 hunks)
  • executors/kc/module/scCallsModule.go (3 hunks)
  • executors/kc/module/scCallsModule_test.go (2 hunks)
  • executors/kc/scCallsExecutor.go (1 hunks)
  • executors/kc/scCallsExecutor_test.go (11 hunks)
  • factory/ethKcBridgeComponents.go (17 hunks)
  • factory/ethKcBridgeComponents_test.go (1 hunks)
  • integrationTests/broadcaster/broadcaster_test.go (1 hunks)
  • integrationTests/mock/tokensRegistryMock.go (4 hunks)
  • integrationTests/relayers/ethToKc_test.go (15 hunks)
  • integrationTests/relayers/kcToEth_test.go (10 hunks)
  • integrationTests/relayers/slowTests/common.go (5 hunks)
  • integrationTests/relayers/slowTests/edgeCases_test.go (2 hunks)
  • integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go (9 hunks)
  • integrationTests/relayers/slowTests/framework/address.go (3 hunks)
  • integrationTests/relayers/slowTests/framework/bridgeComponents.go (2 hunks)
  • integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (11 hunks)
  • integrationTests/relayers/slowTests/framework/common.go (1 hunks)
  • integrationTests/relayers/slowTests/framework/ethereumHandler.go (3 hunks)
  • integrationTests/relayers/slowTests/framework/interface.go (2 hunks)
  • integrationTests/relayers/slowTests/framework/kcHandler.go (38 hunks)
  • integrationTests/relayers/slowTests/framework/keys.go (8 hunks)
  • integrationTests/relayers/slowTests/framework/testSetup.go (15 hunks)
  • integrationTests/relayers/slowTests/framework/tokensRegistry.go (2 hunks)
  • integrationTests/relayers/slowTests/framework/types.go (2 hunks)
  • integrationTests/relayers/slowTests/refundWithChainSimulator_test.go (13 hunks)
  • integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go (1 hunks)
  • integrationTests/relayers/slowTests/startsFromEthereumFlow.go (1 hunks)
  • integrationTests/relayers/slowTests/startsFromKcFlow.go (1 hunks)
  • integrationTests/relayers/slowTests/startsFromMultiversxFlow.go (0 hunks)
  • integrationTests/testscommon.go (1 hunks)
  • p2p/broadcaster.go (4 hunks)
  • p2p/broadcaster_test.go (4 hunks)
  • p2p/errors.go (1 hunks)
  • p2p/interface.go (1 hunks)
  • parsers/errors.go (1 hunks)
  • parsers/kcCodec.go (5 hunks)
  • parsers/kcCodec_test.go (8 hunks)
  • parsers/types.go (1 hunks)
  • parsers/types_test.go (3 hunks)
  • scCallsExecutor.Dockerfile (2 hunks)
  • testsCommon/addressGenerators.go (2 hunks)
  • testsCommon/balanceValidatorStub.go (1 hunks)
  • testsCommon/bridge/bridgeExecutorStub.go (8 hunks)
  • testsCommon/bridge/kcClientStub.go (22 hunks)
  • testsCommon/kcCodecStub.go (3 hunks)
  • testsCommon/roleProviders/kcRoleProviderStub.go (1 hunks)
  • testsCommon/testKcCodec.go (4 hunks)
💤 Files with no reviewable changes (2)
  • bridges/ethMultiversX/constants.go
  • integrationTests/relayers/slowTests/startsFromMultiversxFlow.go
🧰 Additional context used
🧬 Code Graph Analysis (65)
bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go (2)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • ResolvingSetStatusOnKc (20-20)
executors/ethereum/migrationBatchCreator_test.go (3)
executors/ethereum/interface.go (1)
  • KlvDataGetter (32-36)
testsCommon/bridge/dataGetterStub.go (1)
  • DataGetterStub (8-13)
executors/ethereum/migrationBatchCreator.go (1)
  • NewMigrationBatchCreator (39-60)
bridges/ethKc/steps/kcToEth/step04PerformTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (2)
  • GettingPendingBatchFromKc (5-5)
  • ResolvingSetStatusOnKc (20-20)
bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
integrationTests/broadcaster/broadcaster_test.go (2)
integrationTests/testscommon.go (3)
  • Log (21-21)
  • TestKeyGenerator (25-25)
  • TestSingleSigner (28-28)
p2p/interface.go (1)
  • KcRoleProvider (28-31)
integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
  • KlvAddress (12-17)
bridges/ethKc/steps/ethToKc/stepsFactory_test.go (1)
bridges/ethKc/errors.go (1)
  • ErrNilExecutor (27-27)
bridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • GettingPendingBatchFromKc (5-5)
executors/kc/scCallsExecutor_test.go (4)
executors/kc/scCallsExecutor.go (1)
  • ArgsScCallExecutor (35-49)
testsCommon/interactors/proxyStub.go (1)
  • ProxyStub (13-25)
executors/kc/interface.go (1)
  • Codec (26-30)
testsCommon/kcCodecStub.go (1)
  • KcCodecStub (6-9)
bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go (2)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • GettingPendingBatchFromKc (5-5)
integrationTests/relayers/slowTests/edgeCases_test.go (2)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)
  • KcHandler (86-101)
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
  • EthereumHandler (48-63)
bridges/ethKc/steps/kcToEth/stepsFactory.go (3)
bridges/ethKc/steps/interface.go (1)
  • Executor (14-66)
core/types.go (1)
  • MachineStates (12-12)
bridges/ethKc/errors.go (2)
  • ErrNilExecutor (27-27)
  • ErrDuplicatedStepIdentifier (30-30)
bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • GettingPendingBatchFromKc (5-5)
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go (2)
bridges/ethKc/steps/kcToEth/constants.go (3)
  • GettingPendingBatchFromKc (5-5)
  • SigningProposedSetStatusOnKc (26-26)
  • ProposingSetStatusOnKc (23-23)
core/types.go (1)
  • StepIdentifier (9-9)
testsCommon/balanceValidatorStub.go (2)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
clients/klever/client_test.go (2)
core/constants.go (3)
  • MetricKcClientStatus (67-67)
  • MetricLastKcClientError (70-70)
  • MetricLastBlockNonce (79-79)
testsCommon/statusHandlerMock.go (1)
  • StatusHandlerMock (10-15)
bridges/ethKc/steps/kcToEth/stepsFactory_test.go (1)
bridges/ethKc/errors.go (1)
  • ErrNilExecutor (27-27)
testsCommon/testKcCodec.go (1)
parsers/types.go (1)
  • CallData (13-18)
clients/ethereum/client_test.go (4)
testsCommon/addressGenerators.go (2)
  • CreateRandomKcAddress (19-26)
  • CreateRandomEthereumAddress (11-16)
core/batchProcessor/batchProcessor.go (1)
  • ExtractListKlvToEth (32-54)
core/constants.go (2)
  • MetricKcClientStatus (67-67)
  • MetricLastKcClientError (70-70)
testsCommon/statusHandlerMock.go (1)
  • StatusHandlerMock (10-15)
bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • GettingPendingBatchFromKc (5-5)
bridges/ethKc/steps/ethToKc/step01GetPending_test.go (3)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
bridges/ethKc/steps/ethToKc/constants.go (1)
  • ProposingTransferOnKc (8-8)
bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go (4)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
core/batch.go (1)
  • TransferBatch (14-19)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/ethToKc/constants.go (1)
  • SigningProposedTransferOnKc (11-11)
bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (3)
core/batch.go (1)
  • TransferBatch (14-19)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • ProposingSetStatusOnKc (23-23)
testsCommon/addressGenerators.go (1)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go (1)
bridges/ethKc/steps/ethToKc/constants.go (1)
  • GettingPendingBatchFromEthereum (5-5)
p2p/broadcaster.go (3)
p2p/interface.go (3)
  • NetMessenger (12-25)
  • KcRoleProvider (28-31)
  • SignatureProcessor (34-37)
core/types.go (1)
  • BroadcastClient (44-48)
p2p/errors.go (1)
  • ErrNilKcRoleProvider (21-21)
bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go (3)
core/batch.go (1)
  • TransferBatch (14-19)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/ethToKc/constants.go (1)
  • SigningProposedTransferOnKc (11-11)
bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go (2)
bridges/ethKc/steps/ethToKc/constants.go (2)
  • GettingPendingBatchFromEthereum (5-5)
  • SigningProposedTransferOnKc (11-11)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
integrationTests/relayers/slowTests/startsFromEthereumFlow.go (2)
integrationTests/relayers/slowTests/framework/types.go (1)
  • TestTokenParams (49-54)
integrationTests/relayers/slowTests/framework/testSetup.go (1)
  • LogStepMarker (21-21)
integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go (4)
integrationTests/relayers/slowTests/framework/types.go (1)
  • TestTokenParams (49-54)
integrationTests/relayers/slowTests/framework/testSetup.go (1)
  • LogStepMarker (21-21)
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
  • EthereumHandler (48-63)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)
  • KcHandler (86-101)
bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • GettingPendingBatchFromKc (5-5)
clients/klever/client.go (1)
core/constants.go (2)
  • MetricKcClientStatus (67-67)
  • MetricLastKcClientError (70-70)
integrationTests/relayers/slowTests/framework/keys.go (1)
integrationTests/relayers/slowTests/framework/address.go (2)
  • KlvAddress (12-17)
  • NewKlvAddressFromBytes (20-34)
clients/klever/mappers/mappers_test.go (4)
clients/klever/mappers/erc20ToKc.go (1)
  • NewErc20ToKcMapper (17-25)
clients/errors.go (1)
  • ErrNilDataGetter (10-10)
testsCommon/bridge/dataGetterStub.go (1)
  • DataGetterStub (8-13)
clients/klever/mappers/kcToErc20.go (1)
  • NewKcToErc20Mapper (17-25)
clients/klever/mappers/kcToErc20.go (1)
clients/errors.go (1)
  • ErrNilDataGetter (10-10)
core/batchProcessor/batchProcessor.go (2)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batch.go (1)
  • TransferBatch (14-19)
bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go (3)
bridges/ethKc/steps/kcToEth/constants.go (3)
  • GettingPendingBatchFromKc (5-5)
  • WaitingForQuorumOnSetStatus (29-29)
  • SigningProposedSetStatusOnKc (26-26)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
core/types.go (1)
  • StepIdentifier (9-9)
parsers/kcCodec_test.go (1)
parsers/kcCodec.go (1)
  • KcCodec (17-18)
clients/klever/mappers/erc20ToKc.go (1)
clients/errors.go (1)
  • ErrNilDataGetter (10-10)
core/batchProcessor/batchProcessor_test.go (1)
core/batchProcessor/batchProcessor.go (2)
  • ExtractListEthToKlv (58-80)
  • ExtractListKlvToEth (32-54)
testsCommon/bridge/kcClientStub.go (1)
core/batch.go (1)
  • TransferBatch (14-19)
bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go (2)
bridges/ethKc/steps/ethToKc/constants.go (3)
  • GettingPendingBatchFromEthereum (5-5)
  • SigningProposedTransferOnKc (11-11)
  • ProposingTransferOnKc (8-8)
core/types.go (1)
  • StepIdentifier (9-9)
clients/ethereum/client.go (1)
core/constants.go (2)
  • MetricKcClientStatus (67-67)
  • MetricLastKcClientError (70-70)
p2p/broadcaster_test.go (4)
p2p/interface.go (2)
  • KcRoleProvider (28-31)
  • SignatureProcessor (34-37)
testsCommon/roleProviders/kcRoleProviderStub.go (1)
  • KleverRoleProviderStub (8-10)
p2p/broadcaster.go (1)
  • NewBroadcaster (55-87)
p2p/errors.go (1)
  • ErrNilKcRoleProvider (21-21)
executors/ethereum/migrationBatchCreator.go (3)
executors/ethereum/interface.go (3)
  • KlvDataGetter (32-36)
  • Erc20ContractsHolder (19-23)
  • EthereumChainWrapper (39-50)
clients/ethereum/interface.go (1)
  • Erc20ContractsHolder (42-46)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
clients/balanceValidator/interface.go (1)
core/batch.go (1)
  • TransferBatch (14-19)
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
  • KlvAddress (12-17)
parsers/kcCodec.go (2)
parsers/types.go (1)
  • ProxySCCompleteCallData (21-28)
clients/klever/blockchain/address/address.go (1)
  • NewAddressFromBytes (25-43)
config/tomlConfigs_test.go (1)
config/config.go (1)
  • PendingOperationsFilterConfig (184-191)
integrationTests/relayers/slowTests/startsFromKcFlow.go (4)
integrationTests/relayers/slowTests/framework/testSetup.go (2)
  • TestSetup (30-48)
  • LogStepMarker (21-21)
integrationTests/relayers/slowTests/framework/types.go (1)
  • TestTokenParams (49-54)
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
  • EthereumHandler (48-63)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)
  • KcHandler (86-101)
bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go (4)
bridges/ethKc/steps/kcToEth/constants.go (3)
  • GettingPendingBatchFromKc (5-5)
  • ProposingSetStatusOnKc (23-23)
  • ResolvingSetStatusOnKc (20-20)
clients/errors.go (1)
  • ErrNoPendingBatchAvailable (37-37)
core/types.go (1)
  • StepIdentifier (9-9)
core/batch.go (1)
  • TransferBatch (14-19)
bridges/ethKc/interface.go (2)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
bridges/ethKc/steps/kcToEth/step01GetPending_test.go (4)
core/batch.go (1)
  • TransferBatch (14-19)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • ResolvingSetStatusOnKc (20-20)
integrationTests/mock/tokensRegistryMock.go (2)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
integrationTests/testscommon.go (1)
  • Log (21-21)
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go (2)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/kcToEth/constants.go (1)
  • SigningProposedSetStatusOnKc (26-26)
testsCommon/kcCodecStub.go (1)
parsers/types.go (1)
  • ProxySCCompleteCallData (21-28)
bridges/ethKc/steps/ethToKc/semiIntegrated_test.go (1)
core/types.go (1)
  • StepIdentifier (9-9)
bridges/ethKc/steps/interface.go (3)
core/batch.go (1)
  • TransferBatch (14-19)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
bridges/ethKc/bridgeExecutor_test.go (10)
testsCommon/bridge/kcClientStub.go (1)
  • KcClientStub (14-43)
testsCommon/bridge/ethereumClientStub.go (1)
  • EthereumClientStub (14-32)
bridges/ethKc/interface.go (2)
  • TopologyProvider (70-73)
  • BalanceValidator (83-86)
testsCommon/bridge/topologyProviderStub.go (1)
  • TopologyProviderStub (4-6)
testsCommon/statusHandlerMock.go (1)
  • NewStatusHandlerMock (18-24)
testsCommon/balanceValidatorStub.go (1)
  • BalanceValidatorStub (12-14)
bridges/ethKc/bridgeExecutor.go (1)
  • NewBridgeExecutor (63-71)
core/batch.go (1)
  • TransferBatch (14-19)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
core/batchProcessor/batchProcessor.go (2)
  • FromKc (15-15)
  • Direction (11-11)
integrationTests/relayers/slowTests/framework/address.go (2)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
clients/klever/blockchain/address/address.go (2)
  • NewAddressFromBytes (25-43)
  • NewAddress (59-80)
integrationTests/relayers/slowTests/framework/interface.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
  • KlvAddress (12-17)
clients/klever/klvClientDataGetter_test.go (5)
clients/klever/proxy/interface.go (1)
  • Proxy (12-23)
clients/klever/proxy/models/entity.go (1)
  • Proxy (10-10)
testsCommon/interactors/proxyStub.go (1)
  • ProxyStub (13-25)
clients/klever/proxy/models/vmValues.go (2)
  • VmValueRequest (29-35)
  • VmValuesResponseData (8-10)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (2)
integrationTests/relayers/slowTests/framework/address.go (2)
  • KlvAddress (12-17)
  • NewKlvAddressFromBech32 (37-47)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
bridges/ethKc/bridgeExecutor.go (6)
bridges/ethKc/interface.go (2)
  • TopologyProvider (70-73)
  • BalanceValidator (83-86)
core/batch.go (1)
  • TransferBatch (14-19)
core/constants.go (1)
  • MetricNumBatches (38-38)
bridges/ethKc/constants.go (1)
  • InvalidActionID (8-8)
core/batchProcessor/batchProcessor.go (2)
  • ExtractListKlvToEth (32-54)
  • Direction (11-11)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
testsCommon/bridge/bridgeExecutorStub.go (3)
core/batch.go (1)
  • TransferBatch (14-19)
clients/klever/blockchain/address/interfaces.go (1)
  • Address (3-10)
core/batchProcessor/batchProcessor.go (1)
  • Direction (11-11)
🪛 LanguageTool
README.md

[uncategorized] ~21-~21: This verb may not be in the correct form. Consider using a different form for this context.
Context: ... Contribution Thank you for considering to help out with the source code! We welcome co...

(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)


[grammar] ~23-~23: Probable usage error. Use “and” after ‘both’.
Context: ...can make both your efforts much lighter as well as our review and merge procedures quick a...

(BOTH_AS_WELL_AS)

🔇 Additional comments (135)
executors/kc/errors.go (1)

1-1: Package rename to align with branding.

The package is correctly renamed from kleverchain to kc, matching the new directory and branding standards.

bridges/ethKc/converters.go (1)

1-1: Approve package rename.

The package declaration has been updated to ethKc, consistent with the repository's new naming conventions.

bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer_test.go (1)

1-1: Approve package rename.

package has been updated to kctoeth, aligning with the Klever Blockchain-to-Ethereum bridge context.

bridges/ethKc/signaturesHolder.go (1)

1-1: Approve package rename.

The package is correctly renamed to ethKc, aligning with other bridge components.

bridges/ethKc/signaturesHolder_test.go (1)

1-1: Approve package rename.

The test package has been updated to ethKc, ensuring consistency with the implementation code.

executors/kc/scCallsExecutor.go (1)

1-1: Consistent package renaming.

The package declaration has been updated to kc, aligning with the new Klever Blockchain branding. No functional impact.

bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation_test.go (1)

1-1: Align test package to kctoeth.

The package declaration now matches the directory structure and new naming conventions.

testsCommon/roleProviders/kcRoleProviderStub.go (1)

7-7: Update stub comment for KleverRoleProviderStub.

The struct comment has been updated to reflect the new KleverRoleProviderStub name, ensuring consistency.

integrationTests/relayers/slowTests/framework/common.go (1)

12-12: Update Bech32 prefix to klv.

The pubkey converter now uses the "klv" prefix, aligning integration tests with the Klever Blockchain environment.

.github/ISSUE_TEMPLATE/feature.md (1)

3-3: Rebrand issue template to klv-bridge-eth-go.

The about field now references klv-bridge-eth-go, matching the project’s new name.

.github/ISSUE_TEMPLATE/bug-report.md (1)

3-3: Approve renaming in issue template

The reference to klv-bridge-eth-go correctly replaces the old project slug.

#!/bin/bash
# Search for any leftover "multiversx" references across the repository
rg -i multiversx
bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go (2)

1-1: Verify package directory alignment.

The package name was updated to kctoeth. Ensure the file path (bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go) matches this package name to avoid import conflicts.


6-6: Import path updated correctly.

The import now references bridges/ethKc/steps, aligning with the ethKc bridge. Paths and aliases look consistent.

integrationTests/testscommon.go (1)

109-109: Confirm protocol ID consistency.

The ProtocolID was updated from "/erd/relay/1.0.0" to "/klv/relay/1.0.0". Ensure that all peers and production configurations also use the same "/klv/relay/1.0.0" to avoid mismatches during discovery.

factory/ethKcBridgeComponents_test.go (1)

264-265: Assertion looks good – keep naming consistent across tests.

The new assertion on kcToEthStatusHandler mirrors the previous check for ethtoKleverStatusHandler and keeps both directions covered.
Double-check that all other tests & production code refer to the same field name (kcToEthStatusHandler) to avoid compile-time mismatches.

cmd/bridge/config/config.toml (1)

26-28: Comments updated only – no functional impact.

Nothing to flag; the addresses / key paths remain unchanged.
At some point consider validating that these example Bech32 strings are still valid on the latest Klever test-net (not urgent for this PR).

api/swagger/README.md (1)

3-3: Doc string reflects new branding – LGTM.

Pure documentation change, no further action required.

executors/ethereum/bridgeV2Wrappers/ethereumChainWrapper_test.go (1)

266-267: Parameter rename compiles but verify stub/interface alignment.

The stub now expects batchNonceKcETH *big.Int. Ensure the generated Go bindings (abigen) and the production wrapper code use the same parameter identifier; otherwise the anonymous parameter “_” pattern might be safer for tests.

clients/ethereum/wrappers/ethereumChainWrapper_test.go (1)

280-281: Consistent renaming – no logic change.

Same note as above: confirm all mocks & interfaces use the new batchNonceKcETH identifier to prevent accidental drift.

.github/ISSUE_TEMPLATE/question.md (1)

3-3: Correct project reference in issue template

The about field now accurately references klv-bridge-eth-go, aligning with the repository rename.

README.md (2)

1-2: Project name updated in header and description

Renamed occurrences to KleverBlockchain to reflect the rebranding in the main title and first paragraph.


33-33: Documentation link updated

Reference to https://docs.klever.org/ correctly aligns with the Klever Blockchain branding.

cmd/scCallsExecutor/config/config.toml (3)

1-1: Clear default SC proxy address

The default ScProxyBech32Address has been reset to an empty string, removing the old MultiversX address. Ensure users provide the correct Klever Blockchain proxy address or document this requirement.


11-11: Update private key file path

Changed PrivateKeyFile from keys/multiversx.pem to keys/walletKey.pem. Confirm that deployment scripts and documentation refer to the new path.


16-16: Rename filter key

Renamed AllowedMvxAddresses to AllowedKlvAddresses. Verify that the struct field and code references are updated accordingly:

#!/bin/bash
# Verify config key usage
rg -n "AllowedKlvAddresses"
rg -n "AllowedMvxAddresses"
bridges/ethKc/steps/ethToKc/stepsFactory_test.go (3)

1-1: Update package declaration

Package name updated to ethtokc to match the new bridge directory and naming convention.


6-6: Adjust import alias

Import alias updated to ethKc reflecting the new bridges/ethKc path.


18-18: Update error constant reference

Assertion now checks ethKc.ErrNilExecutor, aligning with the renamed constant in bridges/ethKc.

cmd/scCallsExecutor/main.go (2)

12-12: Import path updated

The executor import path now uses executors/kc/module to reflect the renamed package structure.


51-52: CLI authorship metadata updated

Updated Authors to “The Klever Blockchain Team” and contact email to contact@klever.io.

cmd/migration/config/config-mainnet-bsc.toml (1)

21-27: Renamed MultiversX section to Klever
Section [Klever] with nested [Klever.Proxy] correctly replaces the old [MultiversX] and [MultiversX.Proxy] sections. Clearing out contract addresses is expected for this environment.

parsers/types_test.go (3)

28-29: Updated label from MvX to Klv
The test string now correctly references "Klv address" instead of "MvX address" for nil To values.


42-43: Rebranded invalid address label
Changed the expected output label to "Klv address" for invalid addresses, maintaining consistency with the Klever naming standard.


59-60: Rebranded valid address label
The valid address case now uses "Klv address" as the label, aligning the test output with the new naming convention.

.github/workflows/create_release.yml (1)

46-46: Adjusted archive naming prefix
The release archive name has been updated from "multiversx_eth_bridge" to "kc_eth_bridge", matching the Klever rebranding. The version, OS, and architecture concatenation format remains intact.

bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go (2)

50-50: Updated subtest description to Kc context
The subtest now refers to "ResolvingSetStatusOnKc" instead of the old MultiversX identifier, reflecting the renaming.


62-62: Renamed expected step identifier to ResolvingSetStatusOnKc
The expected step constant is now ResolvingSetStatusOnKc, aligning with the updated bridge logic.

bridges/ethKc/steps/kcToEth/stepsFactory_test.go (2)

6-6: Updated import alias to ethKc
Import path and alias updated from ethmultiversx to ethKc, matching the refactored package structure.


18-18: Assert error against ethKc.ErrNilExecutor
The test now correctly compares err to ethKc.ErrNilExecutor instead of the old ethmultiversx constant.

clients/klever/errors.go (1)

20-20: Align error naming with KDA token.
The new errInsufficientKDABalance with message "insufficient KDA balance" correctly reflects the token rename. Ensure all previous references to errInsufficientESDTBalance have been removed or updated.

Run:

rg "errInsufficientESDTBalance"

to confirm no lingering usage.

bridges/ethKc/errors.go (1)

14-15: Rename error for Klever client context.
The updated ErrNilKcClient with message "nil Klever Blockchain client" aligns with the rebranding. Verify that all instantiations or error checks for the old ErrNilMultiversXClient have been updated.

Run:

rg "ErrNilMultiversXClient"

to ensure no residual references.

scCallsExecutor.Dockerfile (3)

4-4: Update builder working directory.
Changed the build-stage WORKDIR from /multiversx to /kc to reflect the new project path. This aligns the build context with the renamed directory structure.


24-24: Set runner working directory.
Changed WORKDIR in the runner stage to /kc. Ensure the path aligns with where the binary is copied for the entrypoint to locate ./scCallsExecutor.


9-9: Adjust build context path.
Updated the secondary build WORKDIR to /kc/cmd/scCallsExecutor, matching the relocated source. Confirm the directory structure matches this path.

Run:

rg -l "cmd/scCallsExecutor" -g "Dockerfile"

to verify the correct directory layout.

clients/klever/proxy/baseProxy.go (1)

40-40: Update constructor comment to reflect Klever.
The comment now reads // newBaseProxy will create a base kc proxy with cache instance. This correctly aligns with rebranding and improves clarity.

cmd/migration/config/config-mainnet-eth.toml (1)

21-25: Rename and clear Klever configuration section.
The [MultiversX] section has been renamed to [Klever] and contract addresses are now empty. Ensure the configuration parser has been updated to read the new section names and that empty addresses are correctly loaded or overridden via environment variables.

executors/kc/module/scCallsModule_test.go (1)

14-15: Verify that the new Bech32 prefix is accepted by the decoder

ScProxyBech32Address now starts with klv.
Please double-check that every Bech32/HRP validator used by the production code is already updated to recognise the klv prefix; otherwise these tests (and the module itself) will fail at runtime.

A quick grep over the repo for hard-coded HRP lists is advisable.

Also applies to: 26-33

integrationTests/broadcaster/broadcaster_test.go (1)

205-215: Field rename looks consistent

MultiversXRoleProviderKcRoleProvider aligns with the new interface in p2p/interface.go. No further issues spotted here. 👍

parsers/errors.go (1)

13-14: Renamed error keeps semantics intact

The new variable name and message are consistent with the re-branding. No functional impact.

clients/balanceValidator/errors.go (1)

8-10: Rename acknowledged

ErrNilKcClient correctly replaces the MultiversX variant and keeps wording uniform with neighbouring errors.

bridges/ethKc/steps/ethToKc/constants.go (2)

19-21: Double-check NumSteps after the refactor

NumSteps remains hard-coded to 5. If additional steps were introduced or removed during the rename, the constant must be updated; otherwise, the executor may prematurely stop processing or over-iterate.


7-21: I’ll broaden the search to catch any leftover “MultiversX” references:

#!/bin/bash
# Search for any lingering MultiversX identifiers in the codebase
rg --fixed-strings 'MultiversX'
bridges/ethKc/steps/ethToKc/step05PerformActionID.go (1)

1-2: Package rename looks good – remember to fix any go:generate or tooling scripts

Changing the package to ethtokc is consistent with the re-branding, but any code-gen directives or build scripts referencing the old path must be updated to avoid broken generators.

bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go (1)

17-21: Ensure ProcessMaxQuorumRetriesOnKc resets its internal counter

The surrounding comment says “resetting counter”, but the method’s name suggests it only checks a limit. Confirm that the reset really happens inside the call; otherwise the step may spin forever after the first overflow.

bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go (2)

6-9: Import path updated – check for stray MultiversX logger replacements

The steps import was correctly repointed to ethKc, but the logger is still coming from
github.com/multiversx/mx-chain-logger-go.
If the project intends to completely de-brand from MultiversX, confirm that:

  1. The MultiversX logger module is still a hard runtime dependency you want to keep.
  2. A KC-namespaced fork (or a more generic logger) does not exist.

No action needed if the dependency stays, otherwise plan a follow-up PR to swap it out.


17-26: Return-step constant renamed correctly

GettingPendingBatchFromMultiversXGettingPendingBatchFromKc keeps the FSM coherent with the new constants file.
No functional concerns spotted here. 👍

bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go (1)

12-14: Test updated to new step identifier – looks good

initialStep now reflects the re-branded constant. Tests remain self-contained and deterministic.

p2p/errors.go (1)

20-22: ```shell
#!/bin/bash

Double-check no stale references to the old error identifier across Go files

grep -R --include='*.go' -n 'ErrNilMultiversXRoleProvider' .


</details>
<details>
<summary>bridges/ethKc/steps/ethToKc/stepsFactory.go (1)</summary>

`14-16`: **Error constants repointed correctly**

`ethKc.ErrNilExecutor` is now used instead of the MultiversX variant – consistent with the
package rename. No issues found.

</details>
<details>
<summary>testsCommon/balanceValidatorStub.go (2)</summary>

`13-13`: **Consistent renaming of token parameter in stub.**

The `CheckTokenCalled` function field now uses `kdaToken`, matching the interface change from `mvxToken`.

---

`17-19`: **Stub's `CheckToken` method updated accordingly.**

The method signature and invocation use `kdaToken`, aligning with the interface rename.

</details>
<details>
<summary>cmd/bridge/main.go (5)</summary>

`49-49`: **Updated log file prefix to reflect Klever branding.**

Renaming to `"kc-eth-bridge"` ensures log files are correctly prefixed for the Klever Bridge.

---

`81-82`: **Updated CLI authorship to Klever Blockchain Team.**

The author name and contact email now reflect the Klever Blockchain Team.

---

`258-258`: **Renamed bridge components variable for Klever.**

Changing to `ethToKcComponents` and using `NewEthKleverBridgeComponents` aligns with the Klever branding.

---

`270-270`: **Start call updated for Klever bridge components.**

Invoking `ethToKcComponents.Start()` matches the renamed variable.

---

`283-283`: **Close call updated for Klever bridge components.**

Calling `ethToKcComponents.Close()` is correctly updated.

</details>
<details>
<summary>clients/klever/client_test.go (3)</summary>

`1047-1048`: **Metric keys updated to Klever context in test setup.**

The calls to `SetStringMetric` now use `MetricKcClientStatus` and `MetricLastKcClientError`, aligning with renamed constants.

---

`1111-1112`: **Reset logic updated to clear Klever metric keys.**

Clearing `MetricKcClientStatus` and `MetricLastKcClientError` ensures tests reset correctly.

---

`1117-1118`: **Assertions updated to check Klever metrics.**

Using `GetStringMetric` with `MetricKcClientStatus` and `MetricLastKcClientError` matches the renamed metrics.

</details>
<details>
<summary>executors/ethereum/interface.go (1)</summary>

`31-36`: **Interface renamed for Klever Blockchain data getter.**

The `MvxDataGetter` was correctly renamed to `KlvDataGetter`, and its comment updated to reflect the Klever Blockchain context.

</details>
<details>
<summary>bridges/ethKc/steps/ethToKc/step05PerformActionID_test.go (7)</summary>

`1-1`: **Package name updated for Kc steps.**

The test package is correctly renamed to `ethtokc` reflecting the new directory context.

---

`17-17`: **Stub method renamed for Klever check.**

`WasActionPerformedOnKcCalled` replaces the MultiversX counterpart, aligning with rebranding.

---

`33-33`: **Stub method renamed for Klever check.**

`WasActionPerformedOnKcCalled` updated in the second test case as well.

---

`49-49`: **Stub method renamed for Klever check.**

The third `WasActionPerformedOnKcCalled` stub update is consistent.

---

`74-74`: **Stub method renamed for Klever action.**

`PerformActionOnKcCalled` replaces the original `PerformActionOnMultiversXCalled`.

---

`90-90`: **Stub method renamed for Klever check.**

`WasActionPerformedOnKcCalled` updated in the final test setup.

---

`96-96`: **Stub method renamed for Klever action.**

`PerformActionOnKcCalled` configured for the success path as expected.

</details>
<details>
<summary>cmd/migration/config/config.toml (1)</summary>

`21-26`: **Empty critical addresses – fail fast or document requirement**

`MultisigContractAddress` and `SafeContractAddress` are now empty.  Runtime code that expects valid, non-zero addresses will likely panic or transact with the *zero* address.

Make sure that:

1. Startup validation rejects empty config values, **or**
2. The defaults are populated with placeholder but *syntactically valid* KC addresses, and
3. The README / sample configs call this out.

</details>
<details>
<summary>bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go (1)</summary>

`110-113`: **Good catch updating the expected step identifier**

The test now asserts against `SigningProposedTransferOnKc`, matching the renamed constant – 👍

</details>
<details>
<summary>bridges/ethKc/steps/ethToKc/step01GetPending_test.go (1)</summary>

`36-40`: **Rename assertions and stub hooks LGTM**

The updated stub hooks (`…FromKc`) and constant (`ProposingTransferOnKc`) align with the new naming scheme and compile cleanly. No functional issues spotted in the modified test logic.  



Also applies to: 55-57, 72-74, 93-98, 117-120, 144-145, 157-158, 171-172

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step10PerformSetStatus_test.go (1)</summary>

`14-18`: **Consistent renaming, no behavioural change**

All renamed stub methods (`…OnKc`) match the updated interface and the test expectations remain intact. Looks good.  



Also applies to: 29-37, 53-57, 68-70, 81-90, 105-107

</details>
<details>
<summary>clients/ethereum/client_test.go (1)</summary>

`1200-1204`: **Metric key update is correct**

The move from `MetricMultiversXClientStatus`/`MetricLastMultiversXClientError` to the Klever-specific counterparts keeps the tests aligned with the production code; additional helper functions already cover the new keys.  



Also applies to: 1315-1322

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus_test.go (4)</summary>

`1-1`: **Package rename looks correct**

The package rename to `kctoeth` is consistent with the wider refactor and should keep the test colocated with its source.

---

`15-21`: **Stub-field names – double-check the struct update**

The test now sets `ProcessQuorumReachedOnKcCalled`. Make sure the `BridgeExecutorStub` definition was renamed accordingly; otherwise the field embedding will silently be wrong and the test will compile but never override the function.  



Also applies to: 18-19

---

`33-36`: **Same remark for `ProcessMaxQuorumRetriesOnKcCalled`**

Confirm the stub really owns this new field name.

---

`48-50`: **LGTM – functional intent preserved**

Behaviour-driven sub-tests remain identical; only the stub hooks were renamed.  



Also applies to: 66-68

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (1)</summary>

`37-40`: **Tests updated correctly – just verify stub signature alignment**

All renamed callbacks (`GetBatchFromKcCalled`, `WaitAndReturnFinalBatchStatusesCalled`, etc.) mirror production code.  
Please confirm the stub struct exports these exact members; otherwise the lambdas will not compile after `go vet`.  



Also applies to: 53-71, 72-83, 84-99, 100-127

</details>
<details>
<summary>parsers/kcCodec_test.go (3)</summary>

`30-38`: **Nil-receiver check kept accurate**

The interface-nil test still reflects the idiomatic Go pattern; no further action needed.

---

`166-174`: **Error constant rename – confirm implementation**

The test now expects `errBufferTooShortForKlvAddress`. Make sure `kcCodec.go` defines and returns this renamed error; otherwise the test will fail at runtime.

---

`248-256`: **Good edge-case coverage**

Keeping the “invalid marker” path ensures backward compatibility with unknown markers. 👍

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)</summary>

`17-23`: **Control-flow remains intact – rename looks safe**

All bridge invocations were changed to `…OnKc`, and fall-back returns were updated to `GettingPendingBatchFromKc`. Logic unchanged, readability preserved.  



Also applies to: 35-41

</details>
<details>
<summary>executors/kc/module/scCallsModule.go (2)</summary>

`59-66`: **Double-check secret-key decoding assumptions**

`hex.DecodeString(string(encodedSk))` assumes `encodedSk` contains a hex-encoded secret key.  
If the PEM helper ever returns raw bytes (or base-64 / DER), this will silently mis-decode and feed garbage into `PrivateKeyFromByteArray`.

Consider validating/guarding the expected format, e.g.:

```diff
- kcPrivateKeyBytes, err := hex.DecodeString(string(encodedSk))
+ kcPrivateKeyBytes, err := hex.DecodeString(strings.TrimSpace(string(encodedSk)))
+ if err == nil && len(kcPrivateKeyBytes) != ed25519.PrivateKeySize {
+     err = fmt.Errorf("unexpected key length: got %d, want %d", len(kcPrivateKeyBytes), ed25519.PrivateKeySize)
+ }

or switch to the helper’s native decode if it already returns the byte slice.


69-85: LGTM on executor argument rename

The switch to kc.ArgsScCallExecutor and parsers.KcCodec{} correctly reflects the re-branding, no other changes required.

clients/klever/mappers/mappers_test.go (1)

17-38: Tests updated coherently with new naming

All mapper constructor tests now use the Kc terminology and still validate nil checks & success paths – looks good.

integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)

84-86: Ensure nil-safety for Bech32()

kdaSafeAddress / kdaMultisigAddress are dereferenced without a nil check. If any caller passes nil the test will panic.
Add a quick guard or document the non-nil contract.

bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)

31-36: expectedError may be undefined in this package

expectedError is referenced but not declared in this file.
If no other file in package kctoeth defines it, the test will not compile.

#!/bin/bash
# Confirm that expectedError is declared somewhere in the kctoeth test package
fd --type f --extension go --exclude '*_test.go' | xargs grep -n --color -e 'var\|const\|func .*expectedError'

If the search returns nothing, add

var expectedError = errors.New("test-error")

close to actionID or import it from a common test helper.

integrationTests/relayers/slowTests/edgeCases_test.go (1)

45-53: Let's broaden the search for any lingering legacy prefixes and inspect the struct definitions for JSON/YAML tags:

#!/bin/bash
# 1. Search for any reference to 'mvx' or 'esdt' (case‐insensitive)
rg -n -I --context 2 -e 'mvx' -e 'esdt'

# 2. Inspect struct definitions around KDA/KLV fields for JSON/YAML tags
rg -n --context 3 'KDASafeExtraBalance'
rg -n --context 3 'ValueToTransferToKlv'
bridges/ethKc/steps/kcToEth/step04PerformTransfer.go (1)

20-26: Constant rename – compile-time safety check

GettingPendingBatchFromKc and ResolvingSetStatusOnKc must exist in the same package where PerformingTransfer & WaitingTransferConfirmation are declared. If you forgot to update constants.go, this will not compile.

#!/bin/bash
# Confirm that the new constants exist
rg -n --fixed-strings -e 'GettingPendingBatchFromKc' -e 'ResolvingSetStatusOnKc' bridges/ethKc/steps | head
config/config.go (1)

187-188: ```shell
#!/bin/bash

Inspect PendingOperationsFilterConfig definition and its struct tags

rg -n "type PendingOperationsFilterConfig" -A8 config/config.go


</details>
<details>
<summary>p2p/broadcaster_test.go (1)</summary>

`34-43`: **LGTM – renamed dependency injected correctly**

The new field `KcRoleProvider` is constructed with a stub and passed through every test case. No functional concerns spotted here.

</details>
<details>
<summary>integrationTests/relayers/slowTests/startsFromEthereumFlow.go (1)</summary>

`15-44`: **Naming update consistent; logic unchanged**

Variable and log-message renames align with the Klever migration; control flow and early-return conditions remain intact. No issues found.

</details>
<details>
<summary>testsCommon/kcCodecStub.go (1)</summary>

`5-33`: **Codec stub renaming looks good**

Only identifiers were updated; behaviour is untouched. The stub still fulfils the codec interface.

</details>
<details>
<summary>clients/klever/client.go (2)</summary>

`480-497`: **Validate new proxy call & error identifier compile correctly**

`GetKDATokenData` and `errInsufficientKDABalance` are newly-introduced names.  
Please double-check that:

1. `proxy.Proxy` exposes `GetKDATokenData(ctx, addr, token)` with the same signature used here (ctx, `address.Address`, `string`) to avoid a compile-time failure.
2. `errInsufficientKDABalance` is declared in the `clients` package (or imported) – otherwise this file will not build.

If either name still uses the old “ESDT” variant elsewhere, update the interface / variable or add the missing declaration.

---

`541-543`: **LGTM – metric keys updated consistently**

The status handler now writes to `MetricKcClientStatus` / `MetricLastKcClientError`, which matches the renamed constants in `core/constants.go`.  
No further action needed.

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go (1)</summary>

`17-23`: **Rename looks consistent**

All method & constant names were switched from *MultiversX* to *Kc* without touching the control flow.  
No issues spotted.

</details>
<details>
<summary>core/constants.go (1)</summary>

`62-71`: **Metrics renamed – revisit dashboards**

New constants for KC metrics are fine and added to `PersistedMetrics`.  
Make sure any Prometheus/Grafana dashboards or alert rules are updated to consume `klever blockchain …` metric names; otherwise they will silently break after deployment.

</details>
<details>
<summary>clients/balanceValidator/interface.go (1)</summary>

`35-35`: **Parameter prefix drift (“kdaBatchID”)**

Most renames use the `klv` prefix for Klever, while this method introduces `kdaBatchID`.  
Check for consistency across the codebase to avoid cognitive overhead.

</details>
<details>
<summary>bridges/ethKc/interface.go (1)</summary>

`83-85`: **Parameter name changed but semantics unchanged – verify downstream callers**

`CheckToken(... kdaToken []byte …)` merely renames the parameter; the behaviour is untouched.  
Please grep for `CheckToken(` callers to be sure they were also updated, otherwise builds will break.

</details>
<details>
<summary>clients/ethereum/client.go (1)</summary>

`425-428`: **Metric keys updated – double-check constant propagation**

`MetricKcClientStatus` / `MetricLastKcClientError` look fine here, but `MetricLastBlockNonce` kept its old name.  
If you’re standardising metric names, decide whether `LastBlockNonce` also deserves the `Kc` prefix.

</details>
<details>
<summary>executors/kc/filters/pendingOperationFilter.go (2)</summary>

`43-45`: **Guard clause overlooks Allowed*Tokens* only path**

`errNoItemsAllowed` is triggered unless *at least one* of `AllowedKlvAddresses`, `AllowedEthAddresses`, **or** `AllowedTokens` is provided.  
If a user intends to rely solely on `AllowedTokens` but leaves both address lists empty, the check still passes – that’s fine – but please double-check this matches the intended policy after the rename (some teams previously required at least one address list).

---

`183-191`: **Order of evaluation makes “deny” truly authoritative – good job**

Nice touch: you keep the “deny first, allow later” model intact after the rename. This prevents an address present in *both* lists from slipping through because of an allow wildcard.

</details>
<details>
<summary>integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)</summary>

`425-433`: **`Add` receiver style is correct – ignore returned value**

Good catch leaving `allowanceValue.Add(...)` without re-assignment; the method mutates the receiver so this is fine.

</details>
<details>
<summary>parsers/kcCodec.go (1)</summary>

`14-18`: **Constant renamed but comment still mentions “address length” ambiguously**

`lenKlvAddress` is set to 32. Confirm this matches `address.AddressBytesLen`; if Klever ever changes encoding you’ll drift silently. Exporting the constant from the address package would remove duplication.

</details>
<details>
<summary>integrationTests/relayers/slowTests/startsFromKcFlow.go (1)</summary>

`50-59`: **Refund verification relies on _only_ Ethereum status**

`areTokensFullyRefunded` checks `IsTransferDoneFromEthereumWithRefund`, but does not re-confirm the KLV side balances. Ensure the helper covers both chains; if not, add an explicit Klever check here.

</details>
<details>
<summary>bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go (1)</summary>

`37-46`: **Possible length mismatch when resolving deposit statuses**

`ResolveNewDepositsStatuses(uint64(len(batch.Statuses)))` uses the length of the *freshly fetched* batch, whereas `storedBatch.Statuses` was just overwritten with the final statuses.  
If a fork/re-org has changed the deposit count, the two batches may diverge.

Confirm that `batch` and `storedBatch` always refer to the same object; otherwise use `len(storedBatch.Statuses)` to avoid off-by-one errors.

</details>
<details>
<summary>core/batchProcessor/batchProcessor.go (2)</summary>

`14-18`: **Renaming looks correct**

`Direction` constants were updated consistently (`FromKc` / `ToKc`).  
No functional impact – good catch-all update.

---

`24-25`: **Reminder – make sure downstream code uses `KdaTokenBytes`**

Every former reference to `MvxTokenBytes` must now use the new field.  
Please search the codebase for stale usages to avoid nil-field panics at runtime.


```shell
#!/bin/bash
# Search for old field names that might still be referenced
rg -n "MvxTokenBytes"
bridges/ethKc/steps/kcToEth/step01GetPending.go (3)

18-22: Client-availability logging message updated – good

Renamed message helps future grep’ing.


57-59: Verify CheckAvailableTokens parameter order

The call signature switched to (ctx, ethTokens, kdaTokenBytes, amounts, direction).
Double-check the underlying method was adapted the same way; otherwise the wrong
slice may reach the smart-contract check.


77-80: Method naming is consistent

resetCountersOnKc aligns with the rest of the rename. No issues spotted.

integrationTests/relayers/kcToEth_test.go (2)

119-120: String constant in stack-trace detector updated – make sure origin matches

"getTotalTransferAmountInPendingKlvBatches" must be the exact function name.
If the implementation differs in capitalisation or suffix (...KcBatches vs
...KlvBatches) the balance-validator shortcut will silently stop working.


252-254: Address helper rename acknowledged

Swapping CreateRandomMultiversXAddress for CreateRandomKcAddress keeps the
test aligned with the new chain. Good refactor.

integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go (2)

152-166: Flow factory renamed – nice cleanup

startsFromKlvFlow and the new call sites compile cleanly.


304-316: Expected-error string changed – double-check runtime match

The tests depend on the relayer emitting
"invalid setup isNativeOnEthereum = true, isNativeOnKc = true".
Ensure the production code produces exactly this text after the rename;
otherwise the log-observer will never fire and the test will hang.

executors/ethereum/migrationBatchCreator.go (2)

40-42: Nil-check updated correctly

Constructor now guards against nil KlvDataGetter; good migration.


179-187: Method calls updated – ensure all interface implementations renamed

creator.kdaDataGetter.GetAllKnownTokens compiles only if every concrete
implementation has already adopted the KlvDataGetter name. Re-run go vet to
confirm.

factory/ethKcBridgeComponents.go (1)

354-366: Broadcaster args mix Ethereum and Klever role providers

SignatureProcessor receives components.ethereumRoleProvider while the same struct also passes KcRoleProvider.
If the broadcaster internally assumes the processor matches the role provider chain, cross-chain signatures may be rejected.

Please double-check the broadcaster API – if two separate providers are indeed intended, rename the arg names for clarity and add tests; otherwise pass the matching Klever role provider.

bridges/ethKc/bridgeExecutor_test.go (1)

1821-1836: kdaTokens is a slice of byte slices – merge uniqueness like ETH tokens

The ETH side is de-duplicated before validation; KDA tokens are only appended as-is, losing the symmetry:

checkedKdaTokens = append(checkedKdaTokens, kdaToken) // duplicates preserved

If the business rule intends aggregated amounts per token, apply the same coalescing logic to KDA tokens to avoid double validation calls.

integrationTests/relayers/slowTests/framework/interface.go (1)

30-46: Return-type rename incomplete – callers may still refer to GetESDTBalance

The method was renamed to GetKDABalance, but downstream tests & helpers may still expect the old name.
Run go vet ./... or a project-wide grep to ensure all invocations were updated.

clients/klever/klvClientDataGetter_test.go (1)

167-1573: LGTM! Consistent test function and variable renaming.

All test function names and variables have been systematically updated from MultiversX/MX references to Klever/Kc equivalents. The renaming is consistent throughout the file and maintains the original test logic.

integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (1)

34-373: LGTM! Comprehensive rebranding to Klever Blockchain.

The changes correctly update all MultiversX references to Klever Blockchain equivalents:

  • Constants renamed (e.g., thousandEgldthousandKlv)
  • Mock instantiation updated to NewKcMock()
  • Address prefix changed to "klv"
  • Type references updated (MvxAddressKlvAddress)
  • Method names updated (GetESDTBalanceGetKDABalance)
  • JSON fields updated (erd_block_timestampklv_block_timestamp)

All changes are consistent with the rebranding objective.

bridges/ethKc/bridgeExecutor.go (1)

1-657: LGTM! Systematic renaming from MultiversX to Klever Blockchain.

The bridge executor has been comprehensively updated with consistent naming changes:

  • Package renamed to ethKc
  • All struct fields and methods updated to use Kc/Klv naming
  • Client references updated (MultiversXClientKcClient)
  • Token parameters renamed (mvxTokenskdaTokens)
  • Batch processor calls updated (ExtractListMvxToEthExtractListKlvToEth)

The renaming is thorough and maintains the original functionality.

bridges/ethKc/steps/interface.go (1)

18-63: LGTM! Interface methods consistently renamed.

All interface methods have been systematically updated to replace MultiversX references with Kc/Klever equivalents. The parameter rename from mvxTokens to kdaTokens in CheckAvailableTokens is also consistent with the new naming convention.

integrationTests/relayers/slowTests/framework/kcHandler.go (2)

19-19: Address the TODO for kdaSystemSCAddress.

The TODO comment indicates uncertainty about the availability of the kdaSystemSCAddress. This should be resolved before merging to ensure the system contract address is properly configured for the Klever Blockchain.


16-18: LGTM! Comprehensive handler migration to Klever Blockchain.

The KcHandler has been thoroughly updated with consistent naming changes:

  • Struct and method receivers renamed from MultiversxHandler to KcHandler
  • Constants updated (e.g., token costs in KLV, KDA roles)
  • Contract paths updated to kda variants
  • All address types changed to KlvAddress
  • Token operations updated to use KDA terminology
  • Method names and parameters consistently renamed

The migration is systematic and maintains the original functionality.

Also applies to: 20-1068

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
integrationTests/mock/ethereumChainMock.go (1)

10-14: Wrong import – breaks compilation (undefined: ethereum).

FilterLogs uses ethereum.FilterQuery, but the imported root module github.com/ethereum/go-ethereum exposes package name geth, not ethereum.
Import the correct sub-package instead:

-	"github.com/ethereum/go-ethereum"
+	"github.com/ethereum/go-ethereum/ethereum"

(or alias it: ethereum "github.com/ethereum/go-ethereum/ethereum").

Without this change the file fails go vet / go test with undefined: ethereum.

🧹 Nitpick comments (1)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)

37-44: Stale file paths still contain “multiversx”.

aggregatorContractPath-testdata/contracts/kda/multiversx-price-aggregator-sc.wasm and friends retain the old brand in their filenames.
Purely cosmetic, but if you plan full re-branding, consider renaming the artifacts to avoid confusion.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 099af2d and 7a1e0fe.

📒 Files selected for processing (20)
  • bridges/ethKc/bridgeExecutor.go (22 hunks)
  • bridges/ethKc/bridgeExecutor_test.go (53 hunks)
  • bridges/ethKc/interface.go (4 hunks)
  • bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go (8 hunks)
  • bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go (2 hunks)
  • clients/balanceValidator/balanceValidator.go (11 hunks)
  • clients/balanceValidator/balanceValidator_test.go (25 hunks)
  • clients/balanceValidator/interface.go (2 hunks)
  • clients/klever/klvClientDataGetter.go (2 hunks)
  • clients/klever/klvClientDataGetter_test.go (29 hunks)
  • config/tomlConfigs_test.go (13 hunks)
  • docker/scCallsExecutor-docker-compose.yml (1 hunks)
  • factory/ethKcBridgeComponents.go (17 hunks)
  • integrationTests/mock/KleverContractStateMock.go (3 hunks)
  • integrationTests/mock/ethereumChainMock.go (2 hunks)
  • integrationTests/relayers/kcToEth_test.go (10 hunks)
  • integrationTests/relayers/slowTests/framework/kcHandler.go (35 hunks)
  • integrationTests/relayers/slowTests/framework/testSetup.go (15 hunks)
  • integrationTests/relayers/slowTests/refundWithChainSimulator_test.go (13 hunks)
  • testsCommon/bridge/kcClientStub.go (22 hunks)
🚧 Files skipped from review as they are similar to previous changes (17)
  • docker/scCallsExecutor-docker-compose.yml
  • clients/klever/klvClientDataGetter.go
  • testsCommon/bridge/kcClientStub.go
  • bridges/ethKc/interface.go
  • bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go
  • clients/balanceValidator/interface.go
  • bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go
  • integrationTests/relayers/slowTests/refundWithChainSimulator_test.go
  • config/tomlConfigs_test.go
  • integrationTests/relayers/kcToEth_test.go
  • factory/ethKcBridgeComponents.go
  • integrationTests/relayers/slowTests/framework/testSetup.go
  • clients/balanceValidator/balanceValidator.go
  • clients/balanceValidator/balanceValidator_test.go
  • bridges/ethKc/bridgeExecutor_test.go
  • clients/klever/klvClientDataGetter_test.go
  • bridges/ethKc/bridgeExecutor.go
🧰 Additional context used
🪛 golangci-lint (1.64.8)
integrationTests/mock/ethereumChainMock.go

48-48: undefined: ethereum

(typecheck)

🔇 Additional comments (1)
integrationTests/mock/KleverContractStateMock.go (1)

69-70: Rename looks consistent – nothing else to do.

The new callback ProposeMultiTransferKdaBatchCalled is added and correctly triggered.

Also applies to: 128-130

nickgs1337
nickgs1337 previously approved these changes Jun 18, 2025
@nickgs1337 nickgs1337 merged commit 6d7df49 into main Jul 2, 2025
1 of 6 checks passed
@nickgs1337 nickgs1337 deleted the KLC-1595-change-naming-to-klever-blockchain branch July 2, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants