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

Add Bitcoin Gold implementation #926

Merged
merged 16 commits into from
May 5, 2020
Merged

Add Bitcoin Gold implementation #926

merged 16 commits into from
May 5, 2020

Conversation

h4x3rotab
Copy link
Contributor

Description

(Update since #911: fixed android and ios integration tests)

Bitcoin Gold is already added to the trustwallet/assets. This PR adds the implementation including the address codec and transaction signing logic.

Testing instructions

Passes unit tests: ./build/tests/tests tests
Create a new address in walletconsole:

> coin btg
Set active coin to: bitcoingold    Use 'coin' to change.  (name: 'bitcoin gold'  symbol: btg  numericalid: 156)
> addrDefault
Result:  btg1q8hnwn2j2vges5u9h9t456zfd46sjxfmxvk3rvl

Types of changes

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

Checklist

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description (e.g. 'Fixes Adopt Zilliqa to bech32 address format #444 ).

@h4x3rotab
Copy link
Contributor Author

https://dev.azure.com/TrustWallet/Trust%20Wallet%20Core/_build/results?buildId=26514&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=40b1ee41-44d6-5bba-aa04-4b76a5c732e5&l=14

docker: Error response from daemon: pull access denied for trustwallet/wallet-core, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

Maybe flaky CI errors?

@codecov
Copy link

codecov bot commented Apr 20, 2020

Codecov Report

Merging #926 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #926      +/-   ##
==========================================
+ Coverage   93.30%   93.37%   +0.06%     
==========================================
  Files         418      424       +6     
  Lines       12167    12384     +217     
==========================================
+ Hits        11353    11564     +211     
- Misses        814      820       +6     
Impacted Files Coverage Δ
src/Bitcoin/Entry.cpp 100.00% <ø> (ø)
src/Bitcoin/Entry.h 100.00% <ø> (ø)
src/interface/TWData.cpp 74.57% <0.00%> (-1.79%) ⬇️
src/Coin.cpp 98.13% <0.00%> (-0.46%) ⬇️
src/XXHash64.h 95.41% <0.00%> (-0.43%) ⬇️
src/Elrond/Address.cpp 100.00% <0.00%> (ø)
src/Elrond/Address.h 100.00% <0.00%> (ø)
src/Elrond/Entry.cpp 100.00% <0.00%> (ø)
src/Elrond/Entry.h 100.00% <0.00%> (ø)
src/Elrond/Signer.cpp 100.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dde1a5...d62673f. Read the comment docs.

@hewigovens
Copy link
Contributor

Hi, We have no plan to add BTG (or other bitcoin forks) to Trust Wallet

@optout21
Copy link
Contributor

The iOS CI build failed with this error:

Testing failed:
	Type 'CoinType' has no member 'bitcoingold'
	Testing cancelled because the build failed.

Maybe BitcoinGold?

@optout21
Copy link
Contributor

The Linux CI build failure is infrastructure-related, we will check.

@h4x3rotab
Copy link
Contributor Author

h4x3rotab commented Apr 20, 2020

Hi, We have no plan to add BTG (or other bitcoin forks) to Trust Wallet

Hi @hewigovens, yeah, we fully understood that. We checked the integration guidance and our first thought was that merging it into wallet-core could benefit more projects and the open source blockchain space, even given TrustWallet is not going to add it. Btw would you mind introduce us the go-to person for a chat? We would really appreciate it.

Copy link
Contributor

@hewigovens hewigovens left a comment

Choose a reason for hiding this comment

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

src/BitcoinGold/Address.cpp Outdated Show resolved Hide resolved
src/BitcoinGold/Address.h Outdated Show resolved Hide resolved
src/BitcoinGold/SegwitAddress.cpp Outdated Show resolved Hide resolved
src/BitcoinGold/SegwitAddress.h Outdated Show resolved Hide resolved
src/BitcoinGold/Signer.cpp Outdated Show resolved Hide resolved
src/proto/BitcoinGold.proto Outdated Show resolved Hide resolved
swift/Tests/CoinAddressDerivationTests.swift Outdated Show resolved Hide resolved
tests/BitcoinGold/TWAddressTests.cpp Outdated Show resolved Hide resolved
tests/BitcoinGold/TWSignerTests.cpp Outdated Show resolved Hide resolved
tests/BitcoinGold/TWSignerTests.cpp Show resolved Hide resolved
@trustwallet trustwallet deleted a comment from optout21 Apr 22, 2020
@hewigovens hewigovens requested a review from optout21 April 22, 2020 00:44
src/proto/BitcoinGold.proto Outdated Show resolved Hide resolved
@optout21
Copy link
Contributor

/azp run

@h4x3rotab
Copy link
Contributor Author

h4x3rotab commented Apr 26, 2020

Missing lock script / zpub tests:

https://developer.trustwallet.com/wallet-core/newblockchain#bitcoin-forks-checklist

Added at 11aa44f. Please take a look :)

@hewigovens
Copy link
Contributor

please rebase master, Android CI should be fixed

.github/CODEOWNERS Outdated Show resolved Hide resolved
Add mainnet transaction url

Co-Authored-By: hewig <[email protected]>
@hewigovens hewigovens requested a review from vikmeup May 4, 2020 22:14
@h4x3rotab
Copy link
Contributor Author

Looks like we are ready to go :)

@optout21 optout21 merged commit 39070cf into trustwallet:master May 5, 2020
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
5 participants