Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1658 bnc part 4 #1809

Merged
merged 63 commits into from
Feb 13, 2025
Merged

1658 bnc part 4 #1809

merged 63 commits into from
Feb 13, 2025

Conversation

lucanicoladebiasi
Copy link
Collaborator

@lucanicoladebiasi lucanicoladebiasi commented Feb 13, 2025

Description

The "delegator" is substituted with the "gas payer" terminology.
This is the last part of the four stages needed to rename coherently the SDK:

  • the sender of a transaction and payer of a non delegated transaction is named origin;
  • the sponsor of a delegated transaction is named gasPayer.

The interface TransactionsExpandedBlockDetail at packages/network/src/thor-client/blocks/types.d.ts keeps the property delegator to adhere to the structure of the ExpandedBlockResponse of the Thor end-point Retrieve a block with URI query set as ?expanded=true.
The interface TransactionsExpandedBlockDetail represents the response of the named end-point exposing the property gasPayer to express the address of the sponsor of the transaction, either the property origin or delegator of the interface.

Fixes # BNC

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change required a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • yarn test:examples
  • yarn test:solo

Test Configuration:

  • Node.js Version: v23.1.0
  • Yarn Version: 1.22.22

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Revised and clarified configuration instructions to emphasize gas payer parameters.
  • Refactor
    • Standardized terminology by updating names throughout network setup and configuration interfaces for improved clarity.
  • Tests
    • Updated test cases and fixtures to align with the new naming convention, ensuring consistent behavior.

# Conflicts:
#	apps/sdk-hardhat-integration/hardhat.config.ts
#	packages/rpc-proxy/README.md
#	packages/rpc-proxy/src/utils/args-validator/args-validator-and-getter.ts
#	packages/rpc-proxy/src/utils/args-validator/args-validator.ts
#	packages/rpc-proxy/src/utils/config-validator/config-validator.ts
#	packages/rpc-proxy/tests/config-files-fixtures/correct-proxy-config-gas-payer-private-key.json
#	packages/rpc-proxy/tests/config-files-fixtures/correct-proxy-config-gas-payer-url.json
# Conflicts:
#	packages/hardhat-plugin/tests/helpers/fixture.ts
@lucanicoladebiasi lucanicoladebiasi added this to the 1.0.0 milestone Feb 13, 2025
@lucanicoladebiasi lucanicoladebiasi self-assigned this Feb 13, 2025
@lucanicoladebiasi lucanicoladebiasi requested a review from a team as a code owner February 13, 2025 09:42
@lucanicoladebiasi lucanicoladebiasi linked an issue Feb 13, 2025 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Feb 13, 2025

Walkthrough

This pull request standardizes terminology by replacing references to "delegator" with "gasPayer" throughout multiple modules. The changes cover documentation updates, configuration file adjustments, script modifications, and test suite renaming across the SDK Hardhat integration, AWS KMS adapter, Hardhat plugin, and network packages. One exception is in the network package where the interface now includes both a renamed field and additional documentation clarifying their roles.

Changes

File(s) Change Summary
apps/sdk-hardhat-integration/README.md, apps/sdk-hardhat-integration/hardhat.config.ts Renamed parameters in gas payer configuration: updated delegatorPrivateKey/delegatorUrl to gasPayerPrivateKey/gasPayerServiceUrl and replaced delegator with gasPayer.
localstack/init/kms.sh Replaced variable CUSTOM_DELEGATOR_ID with CUSTOM_GAS_PAYER_ID and updated the key creation command accordingly.
packages/aws-kms-adapter/README.md, packages/aws-kms-adapter/src/KMSVeChainSigner.ts, packages/aws-kms-adapter/tests/*.test.ts Refactored documentation, constructor parameters, method names, and test variables to replace "delegator" with "gasPayer" for improved clarity in delegation functionality.
packages/hardhat-plugin/src/helpers/provider-helper.ts, packages/hardhat-plugin/src/type-extensions.ts, packages/hardhat-plugin/tests/** Updated configuration and type definitions: renamed delegator to gasPayer in wallet creation helpers, network config objects, and test fixtures.
packages/network/src/thor-client/blocks/types.d.ts, packages/network/tests/**/*fixture.ts Modified transaction detail interfaces and fixtures: replaced the gasPayer property with an additional delegator field (with documentation) and added the property to transaction fixtures.

Sequence Diagram(s)

sequenceDiagram
    participant Config as Hardhat Config
    participant Provider as Provider Helper
    participant Wallet as Wallet Factory
    participant Signer as KMSVeChainSigner

    Config->>Provider: Supply network configuration with gasPayer data
    Provider->>Wallet: Create wallet using gasPayer parameters
    Wallet->>Signer: Instantiate signer with gasPayer provider settings
Loading

Possibly related PRs

  • SRC-01 and SR0-01 #1758: The changes in the main PR are related to the renaming of parameters and properties from "delegator" to "gasPayer," which aligns with similar terminology updates in the retrieved PR's context of handling gas payments.
  • 1658 bnc part 3 #1798: The changes in the main PR are directly related to the modifications in the hardhat.config.ts file regarding the renaming of delegator to gasPayer, which is also reflected in the retrieved PR.
  • Remove ethers #1616: The changes in the main PR are related to the modifications in the KMSVeChainSigner class in the retrieved PR, as both involve renaming parameters and updating the handling of gas payer functionality within the same class.

Suggested labels

Type: Documentation

Suggested reviewers

  • claytonneal

Poem

In code we find a spark of light,
As names transform in the pale moonlight.
Delegators yield to gas payers bright,
With clearer terms our modules now unite.
CodeRabbit smiles—our work is done right!
🚀✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

Copy link
Contributor

@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: 3

🧹 Nitpick comments (5)
packages/network/src/thor-client/blocks/types.d.ts (1)

215-229: Enhance documentation clarity for the delegator property.

While the documentation explains the relationship between delegator and gasPayer, it could be more concise and clearer. Consider restructuring the note to emphasize the key points:

-     * The property name `delegator` is exposed by
-     *   [Tx](https://mainnet.vechain.org/doc/stoplight-ui/#/schemas/Tx)
-     *   response of the end-point
-     *   [Retrieve a block](https://mainnet.vechain.org/doc/stoplight-ui/#/paths/blocks-revision/get)
-     *   with query set as `?expanded=true`.
-     * * In the rest of the SDK the address of the sponsor of the transaction is exposed by properties named
-     *   `gasPayer`.
-     *   It's suggested to read as "delegated" the term written as "delegator".
-     * * This interface exposes the property {@link gasPayer} to express the address of the sponsor of the
-     *   transaction, either {@link origin} or {@link delegator}.
+     * NOTE: This property represents the gas-payer address and is named `delegator` to match the
+     * [Tx schema](https://mainnet.vechain.org/doc/stoplight-ui/#/schemas/Tx) in the block retrieval API.
+     * Throughout the rest of the SDK, this concept is consistently referred to as `gasPayer`.
+     * 
+     * @see {@link gasPayer} - The actual gas payer (either {@link origin} or {@link delegator})
+     * @see [Block API](https://mainnet.vechain.org/doc/stoplight-ui/#/paths/blocks-revision/get)
packages/aws-kms-adapter/src/KMSVeChainSigner.ts (2)

232-232: Consider renaming method for terminology consistency.

The method name concatSignatureIfDelegation still uses the old terminology. Consider renaming it to align with the new "gas payer" terminology.

-    private async concatSignatureIfDelegation(
+    private async concatSignatureIfGasPayer(

246-247: Consider renaming variable for terminology consistency.

The variable name delegatedHash uses the old terminology.

-            const delegatedHash =
-                transaction.getTransactionHash(originAddress).bytes;
+            const gasPayerHash =
+                transaction.getTransactionHash(originAddress).bytes;
packages/aws-kms-adapter/README.md (2)

32-54: Consider enhancing the JSON example with a gasPayer configuration.

While the explanation mentions gasPayer key support, the JSON example could be more helpful by including a complete gasPayer configuration entry.

Consider expanding the example to show both entries:

 [
     {
         "keyId": "00000000-0000-0000-0000-000000000000", 
         "region": "eu-west-1",
         "credentials": { 
             "accessKeyId": "test",
             "secretAccessKey": "test",
             "sessionToken": "test"
         },
         "endpoint": "http://localhost:4599"
-    }
+    },
+    {
+        "keyId": "11111111-1111-1111-1111-111111111111",
+        "region": "eu-west-1",
+        "credentials": {
+            "accessKeyId": "gasPayer",
+            "secretAccessKey": "gasPayer",
+            "sessionToken": "test"
+        },
+        "endpoint": "http://localhost:4599"
+    }
 ]
🧰 Tools
🪛 LanguageTool

[style] ~32-~32: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... as follows (it is an array in case you want to include a gasPayer key, assumed to be t...

(REP_WANT_TO_VB)


161-206: LGTM! Clear and well-structured example.

The example effectively demonstrates the usage of both origin and gasPayer keys with KMS. The comments and variable names are consistent with the new terminology.

Consider adding a brief comment to explain that true in getAddress(true) indicates retrieving the gasPayer's address:

 // Returns the address related to the gasPayer KMS key
-const address = await signerWithGasPayer.getAddress(true);
+const address = await signerWithGasPayer.getAddress(true); // Pass true to get gasPayer's address
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f44714c and ab8fb5f.

📒 Files selected for processing (20)
  • apps/sdk-hardhat-integration/README.md (1 hunks)
  • apps/sdk-hardhat-integration/hardhat.config.ts (3 hunks)
  • localstack/init/kms.sh (1 hunks)
  • packages/aws-kms-adapter/README.md (2 hunks)
  • packages/aws-kms-adapter/src/KMSVeChainSigner.ts (5 hunks)
  • packages/aws-kms-adapter/tests/KMSVeChainSigner.solo.test.ts (6 hunks)
  • packages/aws-kms-adapter/tests/KMSVeChainSigner.testnet.test.ts (5 hunks)
  • packages/aws-kms-adapter/tests/fixture.ts (1 hunks)
  • packages/hardhat-plugin/src/helpers/provider-helper.ts (2 hunks)
  • packages/hardhat-plugin/src/type-extensions.ts (1 hunks)
  • packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts (1 hunks)
  • packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts (1 hunks)
  • packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts (1 hunks)
  • packages/hardhat-plugin/tests/hardhat-mock-projects/simple-vechain-hardhat-project/hardhat.config.ts (2 hunks)
  • packages/hardhat-plugin/tests/helpers/fixture.ts (3 hunks)
  • packages/hardhat-plugin/tests/helpers/provider-helpers.unit.test.ts (1 hunks)
  • packages/hardhat-plugin/tests/simple-vechain-hardhat-project.solo.test.ts (1 hunks)
  • packages/network/src/thor-client/blocks/types.d.ts (1 hunks)
  • packages/network/tests/provider/formatter/fixture.ts (2 hunks)
  • packages/network/tests/thor-client/blocks/fixture.ts (4 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts
  • packages/aws-kms-adapter/tests/KMSVeChainSigner.testnet.test.ts
  • packages/aws-kms-adapter/tests/fixture.ts
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1777
File: packages/errors/src/available-errors/transaction/transaction.ts:33-33
Timestamp: 2025-01-30T17:15:49.377Z
Learning: PR #1777 is part of a phased approach to rename "delegator" terminology to "gas-payer" across the VeChain SDK. The changes are intentionally partial, with remaining occurrences to be addressed in subsequent PRs.
packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts (3)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:29:28.678Z
Learning: The renaming of 'delegator' to 'gasPayer' in configuration files is planned for the next refactoring phase of the project.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts:32-35
Timestamp: 2025-02-07T16:04:18.593Z
Learning: The parent object `delegator` in hardhat configuration files is intentionally left unchanged during the current BNC refactoring phase, with only its inner properties being renamed (e.g., `delegatorPrivateKey` to `gasPayerPrivateKey`). The parent object will be renamed to `gasPayer` in a future phase.
packages/hardhat-plugin/tests/helpers/provider-helpers.unit.test.ts (3)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:29:28.678Z
Learning: The renaming of 'delegator' to 'gasPayer' in configuration files is planned for the next refactoring phase of the project.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts:32-35
Timestamp: 2025-02-07T16:04:18.593Z
Learning: The parent object `delegator` in hardhat configuration files is intentionally left unchanged during the current BNC refactoring phase, with only its inner properties being renamed (e.g., `delegatorPrivateKey` to `gasPayerPrivateKey`). The parent object will be renamed to `gasPayer` in a future phase.
packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts (3)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:29:28.678Z
Learning: The renaming of 'delegator' to 'gasPayer' in configuration files is planned for the next refactoring phase of the project.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts:32-35
Timestamp: 2025-02-07T16:04:18.593Z
Learning: The parent object `delegator` in hardhat configuration files is intentionally left unchanged during the current BNC refactoring phase, with only its inner properties being renamed (e.g., `delegatorPrivateKey` to `gasPayerPrivateKey`). The parent object will be renamed to `gasPayer` in a future phase.
packages/hardhat-plugin/tests/helpers/fixture.ts (3)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:29:28.678Z
Learning: The renaming of 'delegator' to 'gasPayer' in configuration files is planned for the next refactoring phase of the project.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts:32-35
Timestamp: 2025-02-07T16:04:18.593Z
Learning: The parent object `delegator` in hardhat configuration files is intentionally left unchanged during the current BNC refactoring phase, with only its inner properties being renamed (e.g., `delegatorPrivateKey` to `gasPayerPrivateKey`). The parent object will be renamed to `gasPayer` in a future phase.
packages/hardhat-plugin/tests/hardhat-mock-projects/simple-vechain-hardhat-project/hardhat.config.ts (3)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:29:28.678Z
Learning: The renaming of 'delegator' to 'gasPayer' in configuration files is planned for the next refactoring phase of the project.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts:32-35
Timestamp: 2025-02-07T16:04:18.593Z
Learning: The parent object `delegator` in hardhat configuration files is intentionally left unchanged during the current BNC refactoring phase, with only its inner properties being renamed (e.g., `delegatorPrivateKey` to `gasPayerPrivateKey`). The parent object will be renamed to `gasPayer` in a future phase.
packages/hardhat-plugin/src/type-extensions.ts (1)
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1788
File: packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-default-value-project/hardhat.config.ts:0-0
Timestamp: 2025-02-07T15:28:09.555Z
Learning: The `delegator` property in hardhat configuration files is planned to be renamed to `gasPayer` in a future BNC refactoring phase. Until then, it contains the `gasPayerPrivateKey` property.
🪛 markdownlint-cli2 (0.17.2)
apps/sdk-hardhat-integration/README.md

24-24: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: rpc-proxy / test / test
  • GitHub Check: unit-integration-test-browser / Build & Lint (latest)
  • GitHub Check: unit-integration-test-browser / Build & Lint (lts/*)
  • GitHub Check: unit-integration-test-browser / Build & Lint (18)
  • GitHub Check: unit-integration-test / Build & Lint (latest)
  • GitHub Check: unit-integration-test / Build & Lint (lts/*)
  • GitHub Check: unit-integration-test / Build & Lint (18)
  • GitHub Check: test-apps / Install and test example apps
  • GitHub Check: install-build / Build & Lint
  • GitHub Check: Execute doc examples
🔇 Additional comments (16)
packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-no-value-project/hardhat.config.ts (1)

32-35: LGTM! The configuration property has been correctly renamed.

The change from delegator to gasPayer aligns with the PR objectives and maintains the same structure with gasPayerPrivateKey.

packages/hardhat-plugin/tests/hardhat-mock-projects/eth_getTransactionCount-random-value-project/hardhat.config.ts (1)

32-35: LGTM! The configuration property has been correctly renamed.

The change from delegator to gasPayer is consistent with the previous file and maintains the same structure.

packages/hardhat-plugin/src/type-extensions.ts (2)

48-50: LGTM! Documentation has been updated to reflect new terminology.

The parameter descriptions have been correctly updated from delegatorPrivateKey and delegatorUrl to gasPayerPrivateKey and gasPayerServiceUrl.


51-51: LGTM! Interface property has been correctly renamed.

The gasPayer property maintains the same type SignTransactionOptions as the previous delegator property, ensuring type compatibility.

packages/hardhat-plugin/tests/helpers/provider-helpers.unit.test.ts (1)

30-34: LGTM! Test cases have been updated to use new terminology.

The changes correctly update:

  1. The method call from getDelegator to getGasPayer
  2. The property access from networkConfig.delegator to networkConfig.gasPayer
packages/hardhat-plugin/tests/hardhat-mock-projects/simple-vechain-hardhat-project/hardhat.config.ts (1)

32-35: LGTM! Configuration updates align with the new terminology.

The renaming from delegator to gasPayer is consistent with the broader SDK terminology changes.

Also applies to: 50-50

packages/hardhat-plugin/src/helpers/provider-helper.ts (1)

65-66: LGTM! Provider helper updates maintain functionality.

The property access changes from delegator to gasPayer are consistent with the new terminology while preserving the existing functionality.

Also applies to: 79-80

packages/hardhat-plugin/tests/simple-vechain-hardhat-project.solo.test.ts (1)

47-47: LGTM! Test assertions updated correctly.

The test assertion has been properly updated to verify the presence of the new gasPayer property.

apps/sdk-hardhat-integration/hardhat.config.ts (1)

79-101: LGTM! Network configurations updated comprehensively.

The network configurations have been thoroughly updated to use the new gasPayer terminology, including:

  • Network names
  • Configuration properties
  • Documentation comments

Also applies to: 106-128, 162-162

packages/hardhat-plugin/tests/helpers/fixture.ts (1)

40-40: LGTM! Consistent terminology changes.

The renaming from "delegator" to "gasPayer" in the test fixtures is consistent with the PR objectives and maintains test coverage for the gas payer functionality.

Also applies to: 76-76, 118-118

packages/aws-kms-adapter/tests/KMSVeChainSigner.solo.test.ts (1)

56-56: LGTM! Consistent terminology changes in test cases.

The renaming of variables and properties from "delegator" to "gasPayer" is consistent and maintains test coverage for the gas payer functionality.

Also applies to: 67-67, 93-102

packages/aws-kms-adapter/src/KMSVeChainSigner.ts (1)

19-20: LGTM! Clean implementation of gas payer functionality.

The constructor and property changes are well-structured and maintain clear separation between the provider and service URL options.

Also applies to: 24-27, 43-58

localstack/init/kms.sh (1)

5-5: LGTM! Changes align with the new terminology.

The renaming from "delegator" to "gas payer" is consistent with the PR objectives.

Also applies to: 13-14

apps/sdk-hardhat-integration/README.md (1)

24-24: LGTM! Parameter names align with the new terminology.

The renaming of parameters from delegatorPrivateKey and delegatorUrl to gasPayerPrivateKey and gasPayerServiceUrl is consistent with the PR objectives.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

24-24: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

packages/aws-kms-adapter/README.md (2)

10-10: LGTM! Clear feature description.

The feature description accurately reflects the new "gasPayer" terminology, maintaining consistency with the SDK's updated naming conventions.


237-249: LGTM! Clear URL-based gasPayer example.

The example effectively demonstrates URL-based gasPayer configuration, and the comments clearly explain the limitations regarding address retrieval.

Copy link

github-actions bot commented Feb 13, 2025

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 98%
98.96% (4395/4441) 97.01% (1398/1441) 98.9% (906/916)
Title Tests Skipped Failures Errors Time
core 839 0 💤 0 ❌ 0 🔥 2m 36s ⏱️
network 728 0 💤 0 ❌ 0 🔥 5m 26s ⏱️
errors 40 0 💤 0 ❌ 0 🔥 18.448s ⏱️
logging 3 0 💤 0 ❌ 0 🔥 19.51s ⏱️
hardhat-plugin 19 0 💤 0 ❌ 0 🔥 1m 9s ⏱️
aws-kms-adapter 23 0 💤 0 ❌ 0 🔥 1m 37s ⏱️
ethers-adapter 5 0 💤 0 ❌ 0 🔥 1m 24s ⏱️
rpc-proxy 37 0 💤 0 ❌ 0 🔥 1m 30s ⏱️

@lucanicoladebiasi lucanicoladebiasi marked this pull request as draft February 13, 2025 09:50
lucanicoladebiasi and others added 2 commits February 13, 2025 10:10
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Luca Nicola Debiasi <63785793+lucanicoladebiasi@users.noreply.github.com>
Signed-off-by: Luca Nicola Debiasi <63785793+lucanicoladebiasi@users.noreply.github.com>
Copy link
Collaborator Author

@lucanicoladebiasi lucanicoladebiasi left a comment

Choose a reason for hiding this comment

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

CodeRabbit objects not all delegator references are renamed gasPayer: the rabbit is missing the few documented exceptions.

@lucanicoladebiasi lucanicoladebiasi marked this pull request as ready for review February 13, 2025 10:57
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
apps/sdk-hardhat-integration/README.md (1)

24-24: Fix the bullet point indentation.

The bullet point indentation is incorrect. According to markdownlint, it should be 2 spaces instead of 3.

Apply this diff to fix the indentation:

-   - **Gas Payer**: The `gasPayer` field allows you to delegate the transaction to a gasPayer. It supports two optional parameters: `gasPayerPrivateKey` and `gasPayerServiceUrl`.
+  - **Gas Payer**: The `gasPayer` field allows you to delegate the transaction to a gasPayer. It supports two optional parameters: `gasPayerPrivateKey` and `gasPayerServiceUrl`.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

24-24: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ab8fb5f and 35e3abd.

📒 Files selected for processing (2)
  • apps/sdk-hardhat-integration/README.md (1 hunks)
  • packages/aws-kms-adapter/README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/aws-kms-adapter/README.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: lucanicoladebiasi
PR: vechain/vechain-sdk-js#1777
File: packages/errors/src/available-errors/transaction/transaction.ts:33-33
Timestamp: 2025-01-30T17:15:49.377Z
Learning: PR #1777 is part of a phased approach to rename "delegator" terminology to "gas-payer" across the VeChain SDK. The changes are intentionally partial, with remaining occurrences to be addressed in subsequent PRs.
🪛 markdownlint-cli2 (0.17.2)
apps/sdk-hardhat-integration/README.md

24-24: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

🔇 Additional comments (1)
apps/sdk-hardhat-integration/README.md (1)

24-24: LGTM! The terminology update looks good.

The documentation has been successfully updated to use the new "gasPayer" terminology, which aligns with the PR objectives. The parameters gasPayerPrivateKey and gasPayerServiceUrl are clearly documented.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

24-24: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)

@lucanicoladebiasi lucanicoladebiasi merged commit f7de71b into main Feb 13, 2025
17 checks passed
@lucanicoladebiasi lucanicoladebiasi deleted the 1658-bnc---part-4 branch February 13, 2025 11:11
@coderabbitai coderabbitai bot mentioned this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BNC
2 participants