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

[Original, draft] Add Elrond coin #1

Closed
wants to merge 25 commits into from
Closed

Conversation

andreibancioiu
Copy link

@andreibancioiu andreibancioiu commented Apr 11, 2020

Description

Extended Wallet-core with blockchain & coin Elrond.

Testing instructions

  • interacting with walletconsole
  • running the tests

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

New blockchain checklist

  • Add the coin definition to coins.json.
  • Add coin dispatcher to src/Coin.cpp
  • Create tests in tests/Elrond/TWCoinTypeTests.cpp
  • Implement Entry.cpp
  • Implement Address.cpp
  • Implement Transaction.cpp if necessary. Was not necessary.
  • Implement Signer.cpp
  • Write test: mnemonic phrase - > Address derivation test. Put this test in CoinTests.cpp TWHDWalletTests.cpp.
  • Transaction signing tests, at least one mainnet transaction test.
  • Add stake, unstake, get rewards tests if the blockchain is PoS like. Will be added later in time.
  • Implement C interface in src/interface Not applicable.
  • Add tests for TWAnyAddress
  • Add tests for TWAnySigner
  • Add tests in ElrondTests.swift
  • Validate generated code in Android project. Write integration tests. Maiar Android Wallet.
  • Validate generated code in iOS project. Write integration tests. Maiar iOS Wallet.
  • Extend test: CoinAddressDerivationTests.cpp
  • Extend test: CoinAddressValidationTests.cpp
  • Extend test: TWHRPTests.cpp
  • Extend test CoinAddressDerivationTests.kt
  • Extend test CoinAddressDerivationTests.swift
  • Upload coin icon to trustwallet/assets if necessary.

@andreibancioiu andreibancioiu self-assigned this Apr 11, 2020
@andreibancioiu andreibancioiu changed the title Initial commit, add coin and generated files. [WIP] Initial commit, add coin and generated files. Apr 11, 2020
@andreibancioiu andreibancioiu changed the title [WIP] Initial commit, add coin and generated files. [WIP] Add Elrond coin Apr 11, 2020
@andreibancioiu andreibancioiu changed the title [WIP] Add Elrond coin Add Elrond coin Apr 17, 2020
@andreibancioiu andreibancioiu marked this pull request as ready for review April 17, 2020 14:10
include/TrustWalletCore/TWCoinType.h Outdated Show resolved Hide resolved
tests/Elrond/TestAccounts.h Outdated Show resolved Hide resolved
coins.json Outdated Show resolved Hide resolved
src/Elrond/Address.h Show resolved Hide resolved
src/Elrond/Signer.cpp Outdated Show resolved Hide resolved
src/Elrond/Signer.cpp Outdated Show resolved Hide resolved
src/Elrond/Signer.cpp Outdated Show resolved Hide resolved

ASSERT_FALSE(Bech32Address::isValid("", "erd"));
ASSERT_FALSE(Bech32Address::isValid("erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35!", "erd"));
ASSERT_FALSE(Bech32Address::isValid("terd19nu5t7hszckwah5nlcadmk5rlchtugzplznskffpwecygcu0520s9tnyy0", "erd"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

xerd

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -373,4 +373,10 @@ TEST(Coin, ValidateAddressVeChain) {
EXPECT_EQ(normalizeAddress(TWCoinTypeVeChain, "0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f"), "0x9d8A62f656a8d1615C1294fd71e9CFb3E4855A4F");
}

TEST(Coin, ValidateAddressElrond) {
EXPECT_TRUE(validateAddress(TWCoinTypeElrond, "erd1l453hd0gt5gzdp7czpuall8ggt2dcv5zwmfdf3sd3lguxseux2fsmsgldz"));
EXPECT_FALSE(validateAddress(TWCoinTypeElrond, "terd1l453hd0gt5gzdp7czpuall8ggt2dcv5zwmfdf3sd3lguxseux2fsmsgldz"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

xerd

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

ASSERT_FALSE(Address::isValid(""));
ASSERT_FALSE(Address::isValid("foo"));
ASSERT_FALSE(Address::isValid("10z9xdugayn528ksaesdwlhf006fw5sg2qmmm0h52fvxczwgesyvq5pwemr"));
ASSERT_FALSE(Address::isValid("nerd10z9xdugayn528ksaesdwlhf006fw5sg2qmmm0h52fvxczwgesyvq5pwemr"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

xerd

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@andreibancioiu andreibancioiu changed the title Add Elrond coin [Original, draft] Add Elrond coin Apr 23, 2020
@andreibancioiu
Copy link
Author

We can close this PR, the official one is against the parent repository.

@andreibancioiu andreibancioiu deleted the new-coin-elrond branch April 28, 2020 14:37
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.

Adopt Zilliqa to bech32 address format
3 participants