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

[Pactus]: Support Pactus Blockchain #4057

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

b00f
Copy link

@b00f b00f commented Oct 7, 2024

Description

This PR adds support for the Pactus Blockchain in TrustWalletCore.
It follows the Integration Criteria highlighted by TrustWalletCore team.

How to test

This PR includes all the necessary tests to ensure the integration is done properly.
We have also compared the results with the native wallet in Pactus, which is available here and here.

This PR fixes #4056 .

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • Create pull request as draft initially, unless its complete.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description.
  • I have read the guidelines for adding a new blockchain.

Integration Checklist

  • Coin Definition:
    • Add the coin definition to registry.json.
    • Execute pushd codegen-v2 && cargo run -- new-blockchain <coinid> && popd to generate blockchain skeleton and configure integration tests.
    • Execute tools/generate-files.
    • Execute pushd rust && cargo check --tests && popd to check if Rust codebase compiles successfully.
    • Execute make -Cbuild -j12 tests TrezorCryptoTests to check if C++ codebase compiles successfully.
  • Add relevant constants in Curve, Hasher etc., in C++ and Rust, as necessary.
  • Implement functionality in Rust.
    • Entry at rust/chains/tw_<coinid>/src/entry.rs.
    • Address at rust/chains/tw_<coinid>/src/address.rs.
    • Transaction (if necessary) at rust/chains/tw_<coinid>/src/transaction.rs.
    • Signer at rust/chains/tw_<coinid>/src/signer.rs.
    • Compiler at rust/chains/tw_<coinid>/src/compiler.rs.
    • Write unit tests. Put them in the rust/chains/tw_<coinid>/tests directory.
    • Write Rust integration tests. Put them in a subfolder of rust/tw_any_coin/tests/chains/<coinid>
      • Transaction signing tests, at least one mainnet transaction test.
      • Add stake, unstake, get rewards tests if the blockchain is PoS like.
  • Write C++ integration tests. Put them in a subfolder of tests/chains/<CoinId>.
  • Validate generated code in Android an iOS projects. Write integration tests for each.
  • Extend central derivation and validation tests: make sure the following tests are extended with the new coin: CoinAddressDerivationTests.cpp and
    coin_address_derivation_test.rs,
    CoinAddressValidationTests.cpp,
    TWHRPTests.cpp,
    CoinAddressDerivationTests.kt,
    CoinAddressDerivationTests.swift.
  • Upload coin icon to trustwallet/assets if necessary.

@b00f b00f marked this pull request as draft October 7, 2024 07:01
@b00f b00f changed the title Pactus Support Pactus Blockchain Oct 7, 2024
@b00f b00f changed the title Support Pactus Blockchain [Pactus]: Support Pactus Blockchain Oct 7, 2024
@b00f b00f marked this pull request as ready for review October 9, 2024 12:50
@b00f
Copy link
Author

b00f commented Oct 9, 2024

@philiparthurmoore

I hope this message finds you well!

If you have a moment, I would greatly appreciate your review of this pull request. Please let us know if there’s anything we might have missed that needs attention before we proceed with the merge.

Thank you very much for your assistance!

@Milerius
Copy link
Collaborator

Hey @b00f He will review the PR next week - thank you

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.

Add support for Pactus Blockchain
2 participants