-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support Tron network #278
base: master
Are you sure you want to change the base?
Support Tron network #278
Conversation
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
Signed-off-by: Joeky <[email protected]>
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.
Change requests:
- Can you utilize the Ethereum types for Tron where they overlap? For example, one can define the TronAmount as EthereumAmount as follows:
pub type TronAmount = EthereumAmount;
- Can you confirm the mnemonics are different in Tron than Ethereum?
Since Tron is a shameless clone of Ethereum, I believe you can share many of the resources, structs, and methods provided from the Ethereum implementation here.
wagyu/cli/tron.rs
Outdated
// "chinese_simplified" => output::<TronMainnet, ChineseSimplified>(options), | ||
// "chinese_traditional" => output::<TronMainnet, ChineseTraditional>(options), | ||
// "english" => output::<TronMainnet, English>(options), | ||
// "french" => output::<TronMainnet, French>(options), | ||
// "italian" => output::<TronMainnet, Italian>(options), | ||
// "japanese" => output::<TronMainnet, Japanese>(options), | ||
// "korean" => output::<TronMainnet, Korean>(options), | ||
// "spanish" => output::<TronMainnet, Spanish>(options), | ||
// _ => output::<TronMainnet, English>(options), |
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.
nit: Remove commented out code
@@ -9,6 +9,7 @@ pub extern crate wagyu_ethereum as ethereum; | |||
pub extern crate wagyu_model as model; | |||
pub extern crate wagyu_monero as monero; | |||
pub extern crate wagyu_zcash as zcash; | |||
pub extern crate wagyu_tron as tron; |
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.
nit: please order alphabetically
wagyu/main.rs
Outdated
@@ -6,6 +6,7 @@ use wagyu::cli::bitcoin::BitcoinCLI; | |||
use wagyu::cli::ethereum::EthereumCLI; | |||
use wagyu::cli::monero::MoneroCLI; | |||
use wagyu::cli::zcash::ZcashCLI; | |||
use wagyu::cli::tron::TronCLI; |
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.
nit: please order alphabetically
@@ -27,6 +28,7 @@ fn main() -> Result<(), CLIError> { | |||
EthereumCLI::new(), | |||
MoneroCLI::new(), | |||
ZcashCLI::new(), | |||
TronCLI::new(), |
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.
nit: please order alphabetically
@@ -36,6 +38,7 @@ fn main() -> Result<(), CLIError> { | |||
("ethereum", Some(arguments)) => EthereumCLI::print(EthereumCLI::parse(arguments)?), | |||
("monero", Some(arguments)) => MoneroCLI::print(MoneroCLI::parse(arguments)?), | |||
("zcash", Some(arguments)) => ZcashCLI::print(ZcashCLI::parse(arguments)?), | |||
("tron", Some(arguments)) => TronCLI::print(TronCLI::parse(arguments)?), |
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.
nit: please order alphabetically
tron/src/private_key.rs
Outdated
|
||
/// Returns a randomly-generated Tron private key. | ||
fn new<R: Rng>(rng: &mut R) -> Result<Self, PrivateKeyError> { | ||
// let random: [u8; 32] = rng.gen(); |
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.
nit: Remove commented out code
README.md
Outdated
- [3.1.2 Ethereum](#312-ethereum) | ||
- [3.1.3 Monero](#313-monero) | ||
- [3.1.4 Zcash](#314-zcash) | ||
- [3.1.5 Tron](#315-tron) |
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.
nit: please order alphabetically
Cargo.toml
Outdated
@@ -24,7 +24,7 @@ name = "wagyu" | |||
path = "wagyu/main.rs" | |||
|
|||
[workspace] | |||
members = [ "bitcoin", "ethereum", "model", "monero", "zcash" ] | |||
members = [ "bitcoin", "ethereum", "model", "monero", "zcash", "tron" ] |
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.
nit: please order alphabetically
@@ -39,6 +39,7 @@ wagyu-ethereum = { path = "./ethereum", version = "0.6.3" } | |||
wagyu-model = { path = "./model", version = "0.6.3" } | |||
wagyu-monero = { path = "./monero", version = "0.6.3" } | |||
wagyu-zcash = { path = "./zcash", version = "0.6.3" } | |||
wagyu-tron = { path = "./tron", version = "0.6.3" } |
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.
nit: please order alphabetically
Cargo.toml
Outdated
@@ -57,9 +58,10 @@ serde_json = { version = "1.0" } | |||
tiny-keccak = { version = "1.4" } | |||
|
|||
[profile.release] | |||
opt-level = 3 | |||
opt-level = "z" |
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.
Can you help me understand the purpose of changing opt-level
and codegen-units
here?
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.
Changes reverted.
Signed-off-by: Joeky <[email protected]>
As much as I understand your stand on DRY (don't repeat yourself). Here are some thoughts, I would like to keep them independent.
|
Started out quite a while ago, I think it's time for contributing.
With this PR wagyu can generate or import standard/HD trx/trc20 wallets. However, tron transaction isn't implemented yet.