Skip to content

Commit 5c01bd2

Browse files
committed
Merge branch 'master' of github.com:aspectron/rusty-kaspa
2 parents eb71df4 + fcd9c28 commit 5c01bd2

File tree

144 files changed

+3850
-610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+3850
-610
lines changed

Cargo.lock

Lines changed: 66 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ members = [
6363

6464
[workspace.package]
6565
rust-version = "1.82.0"
66-
version = "1.0.0"
66+
version = "1.0.1"
6767
authors = ["Kaspa developers"]
6868
license = "ISC"
6969
repository = "https://github.com/kaspanet/rusty-kaspa"
@@ -81,61 +81,61 @@ include = [
8181

8282
[workspace.dependencies]
8383
# kaspa-testing-integration = { version = "1.0.0", path = "testing/integration" }
84-
kaspa-addresses = { version = "1.0.0", path = "crypto/addresses" }
85-
kaspa-addressmanager = { version = "1.0.0", path = "components/addressmanager" }
86-
kaspa-bip32 = { version = "1.0.0", path = "wallet/bip32" }
87-
kaspa-cli = { version = "1.0.0", path = "cli" }
88-
kaspa-connectionmanager = { version = "1.0.0", path = "components/connectionmanager" }
89-
kaspa-consensus = { version = "1.0.0", path = "consensus" }
90-
kaspa-consensus-core = { version = "1.0.0", path = "consensus/core" }
91-
kaspa-consensus-client = { version = "1.0.0", path = "consensus/client" }
92-
kaspa-consensus-notify = { version = "1.0.0", path = "consensus/notify" }
93-
kaspa-consensus-wasm = { version = "1.0.0", path = "consensus/wasm" }
94-
kaspa-consensusmanager = { version = "1.0.0", path = "components/consensusmanager" }
95-
kaspa-core = { version = "1.0.0", path = "core" }
96-
kaspa-daemon = { version = "1.0.0", path = "daemon" }
97-
kaspa-database = { version = "1.0.0", path = "database" }
98-
kaspa-grpc-client = { version = "1.0.0", path = "rpc/grpc/client" }
99-
kaspa-grpc-core = { version = "1.0.0", path = "rpc/grpc/core" }
100-
kaspa-grpc-server = { version = "1.0.0", path = "rpc/grpc/server" }
101-
kaspa-hashes = { version = "1.0.0", path = "crypto/hashes" }
102-
kaspa-index-core = { version = "1.0.0", path = "indexes/core" }
103-
kaspa-index-processor = { version = "1.0.0", path = "indexes/processor" }
104-
kaspa-math = { version = "1.0.0", path = "math" }
105-
kaspa-merkle = { version = "1.0.0", path = "crypto/merkle" }
106-
kaspa-metrics-core = { version = "1.0.0", path = "metrics/core" }
107-
kaspa-mining = { version = "1.0.0", path = "mining" }
108-
kaspa-mining-errors = { version = "1.0.0", path = "mining/errors" }
109-
kaspa-muhash = { version = "1.0.0", path = "crypto/muhash" }
110-
kaspa-notify = { version = "1.0.0", path = "notify" }
111-
kaspa-p2p-flows = { version = "1.0.0", path = "protocol/flows" }
112-
kaspa-p2p-lib = { version = "1.0.0", path = "protocol/p2p" }
113-
kaspa-p2p-mining = { version = "1.0.0", path = "protocol/mining" }
114-
kaspa-perf-monitor = { version = "1.0.0", path = "metrics/perf_monitor" }
115-
kaspa-pow = { version = "1.0.0", path = "consensus/pow" }
116-
kaspa-rpc-core = { version = "1.0.0", path = "rpc/core" }
117-
kaspa-rpc-macros = { version = "1.0.0", path = "rpc/macros" }
118-
kaspa-rpc-service = { version = "1.0.0", path = "rpc/service" }
119-
kaspa-txscript = { version = "1.0.0", path = "crypto/txscript" }
120-
kaspa-txscript-errors = { version = "1.0.0", path = "crypto/txscript/errors" }
121-
kaspa-utils = { version = "1.0.0", path = "utils" }
122-
kaspa-utils-tower = { version = "1.0.0", path = "utils/tower" }
123-
kaspa-utxoindex = { version = "1.0.0", path = "indexes/utxoindex" }
124-
kaspa-wallet = { version = "1.0.0", path = "wallet/native" }
125-
kaspa-wallet-cli-wasm = { version = "1.0.0", path = "wallet/wasm" }
126-
kaspa-wallet-keys = { version = "1.0.0", path = "wallet/keys" }
127-
kaspa-wallet-pskt = { version = "1.0.0", path = "wallet/pskt" }
128-
kaspa-wallet-core = { version = "1.0.0", path = "wallet/core" }
129-
kaspa-wallet-macros = { version = "1.0.0", path = "wallet/macros" }
130-
kaspa-wasm = { version = "1.0.0", path = "wasm" }
131-
kaspa-wasm-core = { version = "1.0.0", path = "wasm/core" }
132-
kaspa-wrpc-client = { version = "1.0.0", path = "rpc/wrpc/client" }
133-
kaspa-wrpc-proxy = { version = "1.0.0", path = "rpc/wrpc/proxy" }
134-
kaspa-wrpc-server = { version = "1.0.0", path = "rpc/wrpc/server" }
135-
kaspa-wrpc-wasm = { version = "1.0.0", path = "rpc/wrpc/wasm" }
136-
kaspa-wrpc-example-subscriber = { version = "1.0.0", path = "rpc/wrpc/examples/subscriber" }
137-
kaspad = { version = "1.0.0", path = "kaspad" }
138-
kaspa-alloc = { version = "1.0.0", path = "utils/alloc" }
84+
kaspa-addresses = { version = "1.0.1", path = "crypto/addresses" }
85+
kaspa-addressmanager = { version = "1.0.1", path = "components/addressmanager" }
86+
kaspa-bip32 = { version = "1.0.1", path = "wallet/bip32" }
87+
kaspa-cli = { version = "1.0.1", path = "cli" }
88+
kaspa-connectionmanager = { version = "1.0.1", path = "components/connectionmanager" }
89+
kaspa-consensus = { version = "1.0.1", path = "consensus" }
90+
kaspa-consensus-core = { version = "1.0.1", path = "consensus/core" }
91+
kaspa-consensus-client = { version = "1.0.1", path = "consensus/client" }
92+
kaspa-consensus-notify = { version = "1.0.1", path = "consensus/notify" }
93+
kaspa-consensus-wasm = { version = "1.0.1", path = "consensus/wasm" }
94+
kaspa-consensusmanager = { version = "1.0.1", path = "components/consensusmanager" }
95+
kaspa-core = { version = "1.0.1", path = "core" }
96+
kaspa-daemon = { version = "1.0.1", path = "daemon" }
97+
kaspa-database = { version = "1.0.1", path = "database" }
98+
kaspa-grpc-client = { version = "1.0.1", path = "rpc/grpc/client" }
99+
kaspa-grpc-core = { version = "1.0.1", path = "rpc/grpc/core" }
100+
kaspa-grpc-server = { version = "1.0.1", path = "rpc/grpc/server" }
101+
kaspa-hashes = { version = "1.0.1", path = "crypto/hashes" }
102+
kaspa-index-core = { version = "1.0.1", path = "indexes/core" }
103+
kaspa-index-processor = { version = "1.0.1", path = "indexes/processor" }
104+
kaspa-math = { version = "1.0.1", path = "math" }
105+
kaspa-merkle = { version = "1.0.1", path = "crypto/merkle" }
106+
kaspa-metrics-core = { version = "1.0.1", path = "metrics/core" }
107+
kaspa-mining = { version = "1.0.1", path = "mining" }
108+
kaspa-mining-errors = { version = "1.0.1", path = "mining/errors" }
109+
kaspa-muhash = { version = "1.0.1", path = "crypto/muhash" }
110+
kaspa-notify = { version = "1.0.1", path = "notify" }
111+
kaspa-p2p-flows = { version = "1.0.1", path = "protocol/flows" }
112+
kaspa-p2p-lib = { version = "1.0.1", path = "protocol/p2p" }
113+
kaspa-p2p-mining = { version = "1.0.1", path = "protocol/mining" }
114+
kaspa-perf-monitor = { version = "1.0.1", path = "metrics/perf_monitor" }
115+
kaspa-pow = { version = "1.0.1", path = "consensus/pow" }
116+
kaspa-rpc-core = { version = "1.0.1", path = "rpc/core" }
117+
kaspa-rpc-macros = { version = "1.0.1", path = "rpc/macros" }
118+
kaspa-rpc-service = { version = "1.0.1", path = "rpc/service" }
119+
kaspa-txscript = { version = "1.0.1", path = "crypto/txscript" }
120+
kaspa-txscript-errors = { version = "1.0.1", path = "crypto/txscript/errors" }
121+
kaspa-utils = { version = "1.0.1", path = "utils" }
122+
kaspa-utils-tower = { version = "1.0.1", path = "utils/tower" }
123+
kaspa-utxoindex = { version = "1.0.1", path = "indexes/utxoindex" }
124+
kaspa-wallet = { version = "1.0.1", path = "wallet/native" }
125+
kaspa-wallet-cli-wasm = { version = "1.0.1", path = "wallet/wasm" }
126+
kaspa-wallet-keys = { version = "1.0.1", path = "wallet/keys" }
127+
kaspa-wallet-pskt = { version = "1.0.1", path = "wallet/pskt" }
128+
kaspa-wallet-core = { version = "1.0.1", path = "wallet/core" }
129+
kaspa-wallet-macros = { version = "1.0.1", path = "wallet/macros" }
130+
kaspa-wasm = { version = "1.0.1", path = "wasm" }
131+
kaspa-wasm-core = { version = "1.0.1", path = "wasm/core" }
132+
kaspa-wrpc-client = { version = "1.0.1", path = "rpc/wrpc/client" }
133+
kaspa-wrpc-proxy = { version = "1.0.1", path = "rpc/wrpc/proxy" }
134+
kaspa-wrpc-server = { version = "1.0.1", path = "rpc/wrpc/server" }
135+
kaspa-wrpc-wasm = { version = "1.0.1", path = "rpc/wrpc/wasm" }
136+
kaspa-wrpc-example-subscriber = { version = "1.0.1", path = "rpc/wrpc/examples/subscriber" }
137+
kaspad = { version = "1.0.1", path = "kaspad" }
138+
kaspa-alloc = { version = "1.0.1", path = "utils/alloc" }
139139

140140
# external
141141
aes = "0.8.3"
@@ -338,3 +338,4 @@ strip = false
338338

339339
[workspace.lints.clippy]
340340
empty_docs = "allow"
341+
uninlined_format_args = "allow"

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@ The framework is compatible with all major desktop and mobile browsers.
243243
cargo run --release --bin kaspad -- --testnet
244244
```
245245
246-
**Testnet 11**
247-
248-
For participation in the 10BPS test network (TN11), see the following detailed [guide](docs/testnet11.md).
249-
250246
<details>
251247
252248
<summary>

cli/src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,14 @@ impl KaspaCli {
285285

286286
if let Ok(msg) = msg {
287287
match *msg {
288+
Events::WalletList { .. } => {},
288289
Events::WalletPing => {
289290
// log_info!("Kaspa NG - received wallet ping");
290291
},
291292
Events::Metrics { network_id : _, metrics : _ } => {
292293
// log_info!("Kaspa NG - received metrics event {metrics:?}")
293294
}
295+
Events::FeeRate { .. } => {},
294296
Events::Error { message } => { terrorln!(this,"{message}"); },
295297
Events::UtxoProcStart => {},
296298
Events::UtxoProcStop => {},
@@ -787,7 +789,7 @@ impl KaspaCli {
787789
}
788790
SyncState::UtxoResync => Some([style("SYNC").red().to_string(), style("UTXO").black().to_string()].join(" ")),
789791
SyncState::NotSynced => Some([style("SYNC").red().to_string(), style("...").black().to_string()].join(" ")),
790-
SyncState::Synced { .. } => None,
792+
SyncState::Synced => None,
791793
}
792794
} else {
793795
Some(style("SYNC").red().to_string())

cli/src/modules/account.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ impl Account {
234234
count = count.max(1);
235235

236236
let sweep = action.eq("sweep");
237-
238-
self.derivation_scan(&ctx, start, count, window, sweep).await?;
237+
// TODO fee_rate
238+
let fee_rate = None;
239+
self.derivation_scan(&ctx, start, count, window, sweep, fee_rate).await?;
239240
}
240241
v => {
241242
tprintln!(ctx, "unknown command: '{v}'\r\n");
@@ -276,6 +277,7 @@ impl Account {
276277
count: usize,
277278
window: usize,
278279
sweep: bool,
280+
fee_rate: Option<f64>,
279281
) -> Result<()> {
280282
let account = ctx.account().await?;
281283
let (wallet_secret, payment_secret) = ctx.ask_wallet_secret(Some(&account)).await?;
@@ -293,7 +295,9 @@ impl Account {
293295
start + count,
294296
window,
295297
sweep,
298+
fee_rate,
296299
&abortable,
300+
true,
297301
Some(Arc::new(move |processed: usize, _, balance, txid| {
298302
if let Some(txid) = txid {
299303
tprintln!(

cli/src/modules/estimate.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ impl Estimate {
1717
}
1818

1919
let amount_sompi = try_parse_required_nonzero_kaspa_as_sompi_u64(argv.first())?;
20+
// TODO fee_rate
21+
let fee_rate = None;
2022
let priority_fee_sompi = try_parse_optional_kaspa_as_sompi_i64(argv.get(1))?.unwrap_or(0);
2123
let abortable = Abortable::default();
2224

2325
// just use any address for an estimate (change address)
2426
let change_address = account.change_address()?;
2527
let destination = PaymentDestination::PaymentOutputs(PaymentOutputs::from((change_address.clone(), amount_sompi)));
26-
let estimate = account.estimate(destination, priority_fee_sompi.into(), None, &abortable).await?;
28+
// TODO fee_rate
29+
let estimate = account.estimate(destination, fee_rate, priority_fee_sompi.into(), None, &abortable).await?;
2730

2831
tprintln!(ctx, "Estimate - {estimate}");
2932

cli/src/modules/pskb.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ impl Pskb {
4545
let signer = account
4646
.pskb_from_send_generator(
4747
outputs.into(),
48+
// fee_rate
49+
None,
4850
priority_fee_sompi.into(),
4951
None,
5052
wallet_secret.clone(),
@@ -89,12 +91,15 @@ impl Pskb {
8991
"lock" => {
9092
let amount_sompi = try_parse_required_nonzero_kaspa_as_sompi_u64(argv.first())?;
9193
let outputs = PaymentOutputs::from((script_p2sh, amount_sompi));
94+
// TODO fee_rate
95+
let fee_rate = None;
9296
let priority_fee_sompi = try_parse_optional_kaspa_as_sompi_i64(argv.get(1))?.unwrap_or(0);
9397
let abortable = Abortable::default();
9498

9599
let signer = account
96100
.pskb_from_send_generator(
97101
outputs.into(),
102+
fee_rate,
98103
priority_fee_sompi.into(),
99104
None,
100105
wallet_secret.clone(),
@@ -209,13 +214,12 @@ impl Pskb {
209214
for (pskt_index, bundle_inner) in pskb.0.iter().enumerate() {
210215
tprintln!(ctx, "PSKT #{:03} finalized check:", pskt_index + 1);
211216
let pskt: PSKT<Signer> = PSKT::<Signer>::from(bundle_inner.to_owned());
212-
217+
let params = ctx.wallet().network_id()?.into();
213218
let finalizer = pskt.finalizer();
214-
215219
if let Ok(pskt_finalizer) = finalize_pskt_one_or_more_sig_and_redeem_script(finalizer) {
216220
// Verify if extraction is possible.
217221
match pskt_finalizer.extractor() {
218-
Ok(ex) => match ex.extract_tx() {
222+
Ok(ex) => match ex.extract_tx(&params) {
219223
Ok(_) => tprintln!(
220224
ctx,
221225
" Transaction extracted successfully: PSKT is finalized with a valid script signature."

cli/src/modules/send.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ impl Send {
1818

1919
let address = Address::try_from(argv.first().unwrap().as_str())?;
2020
let amount_sompi = try_parse_required_nonzero_kaspa_as_sompi_u64(argv.get(1))?;
21+
// TODO fee_rate
22+
let fee_rate = None;
2123
let priority_fee_sompi = try_parse_optional_kaspa_as_sompi_i64(argv.get(2))?.unwrap_or(0);
2224
let outputs = PaymentOutputs::from((address.clone(), amount_sompi));
2325
let abortable = Abortable::default();
@@ -27,6 +29,7 @@ impl Send {
2729
let (summary, _ids) = account
2830
.send(
2931
outputs.into(),
32+
fee_rate,
3033
priority_fee_sompi.into(),
3134
None,
3235
wallet_secret,

cli/src/modules/sweep.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ impl Sweep {
1010

1111
let account = ctx.wallet().account()?;
1212
let (wallet_secret, payment_secret) = ctx.ask_wallet_secret(Some(&account)).await?;
13+
// TODO fee_rate
14+
let fee_rate = None;
1315
let abortable = Abortable::default();
1416
// let ctx_ = ctx.clone();
1517
let (summary, _ids) = account
1618
.sweep(
1719
wallet_secret,
1820
payment_secret,
21+
fee_rate,
1922
&abortable,
2023
Some(Arc::new(move |_ptx| {
2124
// tprintln!(ctx_, "Sending transaction: {}", ptx.id());

cli/src/modules/transfer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ impl Transfer {
2121
return Err("Cannot transfer to the same account".into());
2222
}
2323
let amount_sompi = try_parse_required_nonzero_kaspa_as_sompi_u64(argv.get(1))?;
24+
// TODO fee_rate
25+
let fee_rate = None;
2426
let priority_fee_sompi = try_parse_optional_kaspa_as_sompi_i64(argv.get(2))?.unwrap_or(0);
2527
let target_address = target_account.receive_address()?;
2628
let (wallet_secret, payment_secret) = ctx.ask_wallet_secret(Some(&account)).await?;
@@ -32,6 +34,7 @@ impl Transfer {
3234
let (summary, _ids) = account
3335
.send(
3436
outputs.into(),
37+
fee_rate,
3538
priority_fee_sompi.into(),
3639
None,
3740
wallet_secret,

0 commit comments

Comments
 (0)