Skip to content

Fix license headers and add comprehensive documentation for claim pallet#491

Merged
akru merged 4 commits intofeat/pallet-eth-ruins-claimfrom
copilot/sub-pr-490
Feb 12, 2026
Merged

Fix license headers and add comprehensive documentation for claim pallet#491
akru merged 4 commits intofeat/pallet-eth-ruins-claimfrom
copilot/sub-pr-490

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Replaced incorrect Polkadot GPL license headers with Robonomics Apache 2.0 license and added missing documentation for the Ethereum-to-Substrate claim pallet.

Changes

License Headers

  • Updated all source files (lib.rs, benchmarking.rs, mock.rs, tests.rs) to use Robonomics Apache 2.0 license instead of Polkadot GPL

In-Code Documentation

  • Added module-level documentation explaining pallet purpose, features, and usage patterns
  • Documented all Config trait parameters with context (e.g., Prefix for signature replay protection, PalletId for account derivation)
  • Added function documentation with parameter descriptions and error conditions
  • Documented helper functions (ethereum_signable_message, eth_recover, process_claim) and test utilities

README.md

Created comprehensive user-facing documentation including:

  • Configuration examples with runtime setup
  • Complete claim flow with code examples for web3.js, ethers.js, and MetaMask
  • Governance operations (adding claims, funding pallet account)
  • Architecture details (storage, extrinsics, events)
  • Security considerations (signature format, replay protection, one-time claims)
  • Troubleshooting guide for common issues

All code examples correctly demonstrate signing with the configured prefix prepended to the account ID.

Example usage from README:

// Sign destination account with Ethereum key (including prefix)
const accountBytes = api.createType('AccountId', destinationAccount).toU8a();
const accountHex = u8aToHex(accountBytes, -1, false);
const prefix = 'Pay RWS to the Robonomics account:';
const message = prefix + accountHex;
const signature = await wallet.signMessage(message);

// Submit claim
await api.tx.claims.claim(destinationAccount, signature).send();

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 12, 2026 15:09
Co-authored-by: akru <786394+akru@users.noreply.github.com>
Co-authored-by: akru <786394+akru@users.noreply.github.com>
Copilot AI changed the title [WIP] Add simple claim function based on pallet-robonomics Fix license headers and add comprehensive documentation for claim pallet Feb 12, 2026
Copilot AI requested a review from akru February 12, 2026 15:14
@akru
Copy link
Member

akru commented Feb 12, 2026

@copilot dont forget about Prefix in examples.

Co-authored-by: akru <786394+akru@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 12, 2026

@copilot dont forget about Prefix in examples.

Fixed in commit 107e097. Updated all code examples to include the prefix when signing messages:

const prefix = 'Pay RWS to the Robonomics account:';
const message = prefix + accountHex;
const signature = await wallet.signMessage(message);

The examples now correctly show that users must construct the message as {Prefix}{hex_account_id} before signing, and explain that personal_sign automatically adds the Ethereum message wrapper.

@akru akru marked this pull request as ready for review February 12, 2026 15:24
@akru akru merged commit 5ad89cd into feat/pallet-eth-ruins-claim Feb 12, 2026
@akru akru deleted the copilot/sub-pr-490 branch February 12, 2026 15:24
Copilot AI restored the copilot/sub-pr-490 branch February 12, 2026 15:24
Copilot stopped work on behalf of akru due to an error February 12, 2026 15:24
akru added a commit that referenced this pull request Feb 13, 2026
* Added pallet-robonomics-claim

* Fix license headers and add comprehensive documentation for claim pallet (#491)

* Initial plan

* Fix license headers and improve documentation for claim pallet

Co-authored-by: akru <786394+akru@users.noreply.github.com>

* Fix README documentation issues

Co-authored-by: akru <786394+akru@users.noreply.github.com>

* Add prefix to signing examples in README

Co-authored-by: akru <786394+akru@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: akru <786394+akru@users.noreply.github.com>

* Apply auto-formatting changes

* Rename misleading test function in claim pallet (#492)

* Initial plan

* Rename test to better reflect its purpose

Co-authored-by: akru <786394+akru@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: akru <786394+akru@users.noreply.github.com>

* Update lib.rs

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix xcm-info tests

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants