-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Elrond blockchain #929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #929 +/- ##
==========================================
+ Coverage 93.30% 93.35% +0.04%
==========================================
Files 418 424 +6
Lines 12167 12241 +74
==========================================
+ Hits 11353 11427 +74
Misses 814 814
Continue to review full report at Codecov.
|
Hi, have you checked the integration criteria? pr won't be accepted if not meets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments, can you rebase master? CI should be fixed
@@ -43,6 +43,7 @@ This list is generated from [./coins.json](../coins.json) | |||
| 461 | Filecoin | FIL | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/filecoin/info/logo.png" width="32" /> | <https://filecoin.io/> | | |||
| 500 | Theta | THETA | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/theta/info/logo.png" width="32" /> | <https://www.thetatoken.org> | | |||
| 501 | Solana | SOL | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png" width="32" /> | <https://solana.com> | | |||
| 508 | Elrond | ERD | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/elrond/info/logo.png" width="32" /> | <https://elrond.com/> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logo.png is 404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, we did not open a pull request against the repository trustwallet/assets
yet, but we are bootstrapping this flow as well.
string value = 2; | ||
string receiver = 3; | ||
string sender = 4; | ||
uint64 gas_price = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elrond decimals is 18, overflow if you use type uint64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good question. However we expect gas_price
to be much, much lower than max(uint64)
for any transaction, with respect to our network's economics. The gas_price
, chosen by the issuer of the transaction, is per gas unit - while gas_limit
(the number of gas units) is constrained to have a quite high (~50000) lower bound, and thus a very large gas_price
would be prohibitive (balance exhaustion).
Once the transaction reaches the network, we use big numbers
to perform calculations on this matter.
tests/Elrond/SignerTests.cpp
Outdated
auto signature = output.signature(); | ||
auto signedTransaction = output.signed_transaction(); | ||
auto expectedSignature = "b88ad2fe98a7316ea432a0a76c18cd87200fe75f27a8f053ea6532b40317dbec5136c5463aef132ae951b7e60d45d921caaa5903e70821dcda98f237d4ec4308"; | ||
auto expectedSignedTransaction = (boost::format(R"({"nonce":0,"value":"0","receiver":"%1%","sender":"%2%","gasPrice":200000000000000,"gasLimit":500000000,"data":"foo","signature":"%3%"})") % BOB_BECH32 % ALICE_BECH32 % expectedSignature).str(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a valid tx in block explorer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is - the encoded transaction to be sent to the blockchain / network would look like this:
{
"nonce": 0,
"value": "0",
"sender": "erd1l453hd0gt5gzdp7czpuall8ggt2dcv5zwmfdf3sd3lguxseux2fsmsgldz",
"receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
"gasPrice": 200000000000000,
"gasLimit": 500000000,
"data": "foo",
"signature": "b88ad2fe98a7316ea432a0a76c18cd87200fe75f27a8f053ea6532b40317dbec5136c5463aef132ae951b7e60d45d921caaa5903e70821dcda98f237d4ec4308"
}
The computed hash (returned upon invoking the API) is cbecce3712064fe8b14bd668f02cf348d4ee5e4c73836d0a7e25482e5d0056d9
, and the link in block explorer would be:
The link above is currently available (and will be until a hard reset of our testnet).
Does this answer the question?
7e1ae37
to
ae0a056
Compare
@hewigovens thanks a lot for your review! We have applied the fixes and added some responses. |
Description
Extended Wallet-core with blockchain & coin Elrond.
Testing instructions
walletconsole
Types of changes
Checklist
[WIP]
if necessary.New blockchain checklist
coins.json
.src/Coin.cpp
tests/Elrond/TWCoinTypeTests.cpp
Entry.cpp
Address.cpp
Implement. Was not necessary.Transaction.cpp
if necessarySigner.cpp
CoinTests.cpp
TWHDWalletTests.cpp
.Add stake, unstake, get rewards tests if the blockchain is PoS like.Will be added later in time.Implement C interface inNot applicable.src/interface
TWAnyAddress
TWAnySigner
ElrondTests.swift
CoinAddressDerivationTests.cpp
CoinAddressValidationTests.cpp
TWHRPTests.cpp
CoinAddressDerivationTests.kt
CoinAddressDerivationTests.swift
trustwallet/assets
if necessary.