-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SUI]: Move SUI blockchain to Rust (#3769)
* feat(Sui): Add Sui Rust skeleton files * feat(ronin): reorganize tw_aptos, tw_ethereum, tw_ronin, tw_internet_computer * feat(ronin): Implement `SuiAddress` * feat(sui): Implement pay, paySui, payAllSui, request_addStake, request_withdrawStake * feat(sui): Add Protobuf transaction types * feat(sui): Remove unnecessary derives * feat(sui): Implement direct signing * feat(merlin): Change symbol from ETH to BTC * feat(sui): Add direct sign tests * feat(solana): Add delegate stake with priority fee test * feat(sui): Add pay_sui, pay_all_sui, pay, request_add_stake, request_withdraw_stake * feat(sui): Implement transaction preimage and compile functions * feat(sui): Add `pay` and `pay_sui` tests * feat(sui): Add split, merge sui and token tests * feat(sui): Add pay_all_sui test * feat(sui): Add request_addStake test * feat(sui): Fix direct signing to support legacy tests * feat(sui): Add compile test * feat(sui): Add compile direct test * feat(sui): Replace C++ implementation with Rust FFI * feat(sui): Add `test_sui_sign_undelegate_sui` test * feat(sui): Add Android, iOS tests * feat(sui): Fix tests * Add fuzz tests * feat(sui): Add TransferObject transaction type * Add fuzz tests * feat(sui): Comment TransferObject Protobuf message * feat(sui): Fix C++ includes
- Loading branch information
1 parent
41bd373
commit 49a36fc
Showing
122 changed files
with
2,890 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "tw_aptos" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde_json = "1.0" | ||
tw_coin_entry = { path = "../../tw_coin_entry" } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_keypair = { path = "../../tw_keypair" } | ||
tw_proto = { path = "../../tw_proto" } | ||
tw_number = { path = "../../tw_number" } | ||
tw_hash = { path = "../../tw_hash" } | ||
tw_memory = { path = "../../tw_memory" } | ||
move-core-types = { git = "https://github.com/move-language/move", rev = "ea70797099baea64f05194a918cebd69ed02b285", features = ["address32"] } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_bytes = "0.11.12" | ||
|
||
[dev-dependencies] | ||
tw_coin_entry = { path = "../../tw_coin_entry", features = ["test-utils"] } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_number = { path = "../../tw_number", features = ["helpers"] } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "tw_ethereum" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
tw_coin_entry = { path = "../../tw_coin_entry" } | ||
tw_evm = { path = "../../tw_evm" } | ||
tw_keypair = { path = "../../tw_keypair" } | ||
tw_proto = { path = "../../tw_proto" } | ||
|
||
[dev-dependencies] | ||
tw_coin_entry = { path = "../../tw_coin_entry", features = ["test-utils"] } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_number = { path = "../../tw_number", features = ["helpers"] } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "tw_internet_computer" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
quick-protobuf = "0.8.1" | ||
serde = { version = "1.0", features = ["derive"] } | ||
tw_coin_entry = { path = "../../tw_coin_entry" } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_hash = { path = "../../tw_hash" } | ||
tw_keypair = { path = "../../tw_keypair" } | ||
tw_memory = { path = "../../tw_memory" } | ||
tw_proto = { path = "../../tw_proto" } | ||
|
||
[build-dependencies] | ||
pb-rs = "0.10.0" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "tw_ronin" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
tw_coin_entry = { path = "../../tw_coin_entry" } | ||
tw_evm = { path = "../../tw_evm" } | ||
tw_keypair = { path = "../../tw_keypair" } | ||
tw_memory = { path = "../../tw_memory" } | ||
tw_proto = { path = "../../tw_proto" } | ||
|
||
[dev-dependencies] | ||
tw_coin_entry = { path = "../../tw_coin_entry", features = ["test-utils"] } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_number = { path = "../../tw_number", features = ["helpers"] } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "tw_sui" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
indexmap = "2.0" | ||
move-core-types = { git = "https://github.com/move-language/move", rev = "ea70797099baea64f05194a918cebd69ed02b285", features = ["address32"] } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_repr = "0.1" | ||
tw_coin_entry = { path = "../../tw_coin_entry" } | ||
tw_encoding = { path = "../../tw_encoding" } | ||
tw_hash = { path = "../../tw_hash" } | ||
tw_keypair = { path = "../../tw_keypair" } | ||
tw_memory = { path = "../../tw_memory" } | ||
tw_proto = { path = "../../tw_proto" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
target | ||
corpus | ||
artifacts | ||
coverage | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "tw_sui-fuzz" | ||
version = "0.0.0" | ||
publish = false | ||
edition = "2021" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = "0.4" | ||
tw_any_coin = { path = "../../../tw_any_coin", features = ["test-utils"] } | ||
tw_coin_registry = { path = "../../../tw_coin_registry" } | ||
tw_proto = { path = "../../../tw_proto", features = ["fuzz"] } | ||
|
||
[dependencies.tw_sui] | ||
path = ".." | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[profile.release] | ||
debug = 1 | ||
|
||
[[bin]] | ||
name = "sign" | ||
path = "fuzz_targets/sign.rs" | ||
test = false | ||
doc = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Copyright © 2017 Trust Wallet. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_any_coin::test_utils::sign_utils::AnySignerHelper; | ||
use tw_coin_registry::coin_type::CoinType; | ||
use tw_proto::Sui::Proto; | ||
|
||
fuzz_target!(|input: Proto::SigningInput<'_>| { | ||
let mut signer = AnySignerHelper::<Proto::SigningOutput>::default(); | ||
let _ = signer.sign(CoinType::Sui, input); | ||
}); |
Oops, something went wrong.