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

feat(zcoin): allow ARRR/ZCOIN compilation in wasm #1805

Merged
merged 32 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
653d1cc
allow ARRR compilation in wasm
borngraced May 5, 2023
7ffbf28
fix typo
borngraced May 5, 2023
7b745e1
minor changes
borngraced May 5, 2023
81f9790
minor changes and allow unused
borngraced May 9, 2023
b0cc19c
export SyncStatus as pub
borngraced May 9, 2023
2cd3da2
add error ZCoinBalanceError for balance error
borngraced May 9, 2023
d8f8fcc
Merge remote-tracking branch 'origin/dev' into arrr-wasm
borngraced May 10, 2023
f59c42e
fix merge conflicts
borngraced May 11, 2023
5db9c45
fix checks
borngraced May 11, 2023
b3e5fa6
save dev state
borngraced May 17, 2023
c753125
save dev state
borngraced May 17, 2023
607bfd2
make walletdb compatible for native and wasm
borngraced May 17, 2023
680fd8f
Merge branch 'dev' into arrr-wasm
borngraced May 17, 2023
f560e80
apply patch
borngraced May 17, 2023
418f074
minor changes
borngraced May 17, 2023
8ebb378
use zcoin_builder.ctx without ref
borngraced May 17, 2023
2e6b465
add all walletdb table for wasm
borngraced May 18, 2023
4878318
add table to naming
borngraced May 18, 2023
fbaeb8a
fix review notes
borngraced May 24, 2023
af55d86
Merge remote-tracking branch 'origin/dev' into arrr-wasm
borngraced May 24, 2023
00567f9
fix review notes
borngraced May 24, 2023
bc2b2a3
refactor duplicate errors
borngraced May 26, 2023
2d41590
fix build error
borngraced May 27, 2023
5a5123d
cleanup and minor changes
borngraced May 29, 2023
2f9b94a
fix bugs in wallet indexeddb indexes
borngraced May 30, 2023
2906e80
fix lint
borngraced May 30, 2023
48596c8
minor changes
borngraced Jun 1, 2023
33289e0
Merge remote-tracking branch 'origin/dev' into arrr-wasm
borngraced Jun 8, 2023
e41f3e2
fix merge conflicts carg
borngraced Jun 9, 2023
a14232a
fix merge conflicts
borngraced Jun 9, 2023
d474608
Merge branch 'arrr-wasm' of https://github.com/KomodoPlatform/atomicD…
borngraced Jun 9, 2023
dd9a4a3
remove line break
borngraced Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mm2src/coins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }
# We don't need the default web3 features at all since we added our own web3 transport using shared HYPER instance.
web3 = { git = "https://github.com/KomodoPlatform/rust-web3", tag = "v0.19.0", default-features = false }
zbase32 = "0.1.2"
zcash_client_backend = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.0.0" }
zcash_primitives = { features = ["transparent-inputs"], git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.0.0" }
zcash_proofs = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.0.0" }
zcash_client_backend = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.3.0" }
zcash_primitives = { features = ["transparent-inputs"], git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.3.0" }
zcash_proofs = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.3.0" }

[target.'cfg(all(not(target_os = "ios"), not(target_os = "android"), not(target_arch = "wasm32")))'.dependencies]
bincode = { version = "1.3.3", default-features = false, optional = true }
Expand Down Expand Up @@ -143,7 +143,8 @@ tokio = { version = "1.20" }
tokio-rustls = { version = "0.23" }
tonic = { version = "0.7", features = ["tls", "tls-webpki-roots", "compression"] }
webpki-roots = { version = "0.22" }
zcash_client_sqlite = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.0.0" }
zcash_client_sqlite = { git = "https://github.com/KomodoPlatform/librustzcash.git", tag = "k-1.3.0" }

shamardy marked this conversation as resolved.
Show resolved Hide resolved

[target.'cfg(windows)'.dependencies]
winapi = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/z_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ cfg_native!(

use common::{async_blocking, calc_total_pages, PagingOptionsEnum};
use db_common::sqlite::offset_by_id;
use db_common::sqlite::rusqlite::{Error as SqlError, Row, NO_PARAMS};
use db_common::sqlite::rusqlite::{Error as SqlError, Row};
use db_common::sqlite::sql_builder::{name, SqlBuilder, SqlName};
use zcash_client_backend::data_api::WalletRead;
use zcash_client_backend::wallet::{AccountId};
Expand Down
6 changes: 3 additions & 3 deletions mm2src/coins/z_coin/storage/blockdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use zcash_client_backend::proto::compact_formats::CompactBlock;
use zcash_primitives::consensus::BlockHeight;

cfg_native!(
use db_common::sqlite::rusqlite::{params, Connection, NO_PARAMS};
use db_common::sqlite::rusqlite::{params, Connection};
use db_common::sqlite::{query_single_row, run_optimization_pragmas};
use protobuf::Message;
use mm2_err_handle::prelude::*;
Expand Down Expand Up @@ -61,7 +61,7 @@ impl BlockDbImpl {
height INTEGER PRIMARY KEY,
data BLOB NOT NULL
)",
NO_PARAMS,
[],
)
.map_to_mm(|err| BlockDbError::SqliteError(SqliteClientError::from(err)))?;

Expand All @@ -75,7 +75,7 @@ impl BlockDbImpl {
Ok(query_single_row(
&self.db.lock().unwrap(),
"SELECT height FROM compactblocks ORDER BY height DESC LIMIT 1",
NO_PARAMS,
[],
|row| row.get(0),
)?
.unwrap_or(0))
Expand Down