Skip to content

Commit ea6fef7

Browse files
Update SnarkVM to v1.4.0 and correct doc comments
1 parent 512b11e commit ea6fef7

File tree

10 files changed

+511
-283
lines changed

10 files changed

+511
-283
lines changed

sdk/src/program-manager.ts

Lines changed: 298 additions & 112 deletions
Large diffs are not rendered by default.

wasm/Cargo.lock

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

wasm/Cargo.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,37 @@ crate-type = [ "cdylib", "rlib" ]
2222
doctest = false
2323

2424
[dependencies.snarkvm-circuit-network]
25-
version = "1.2.1"
25+
version = "1.4.0"
2626

2727
[dependencies.snarkvm-console]
28-
version = "1.2.1"
28+
version = "1.4.0"
2929
features = [ "wasm" ]
3030

3131
[dependencies.snarkvm-ledger-block]
32-
version = "1.2.1"
32+
version = "1.4.0"
3333
features = [ "wasm" ]
3434

3535
[dependencies.snarkvm-ledger-query]
36-
version = "1.2.1"
36+
version = "1.4.0"
3737
features = [ "async", "wasm" ]
3838

3939
[dependencies.snarkvm-ledger-store]
40-
version = "1.2.1"
40+
version = "1.4.0"
4141

4242
[dependencies.snarkvm-parameters]
43-
version = "1.2.1"
43+
version = "1.4.0"
44+
features = [ "wasm" ]
45+
46+
[dependencies.snarkvm-synthesizer-program]
47+
version = "1.4.0"
4448
features = [ "wasm" ]
4549

4650
[dependencies.snarkvm-synthesizer]
47-
version = "1.2.1"
51+
version = "1.4.0"
4852
features = [ "async", "wasm" ]
4953

5054
[dependencies.snarkvm-wasm]
51-
version = "1.2.1"
55+
version = "1.4.0"
5256
features = [ "console", "fields", "utilities" ]
5357

5458
[dependencies.anyhow]

wasm/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,4 @@ const networks = [
197197
"mainnet",
198198
];
199199

200-
await Promise.all(networks.map(build));
200+
await Promise.all(networks.map(build));

wasm/src/ledger/transaction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ impl Transaction {
282282

283283
// Extract the fee execution.
284284
let fee = match &self.0 {
285-
TransactionNative::Deploy(_, _, _, fee) => Some(fee),
286-
TransactionNative::Execute(_, _, fee) => fee.as_ref(),
285+
TransactionNative::Deploy(_, _, _, _, fee) => Some(fee),
286+
TransactionNative::Execute(_, _, _, fee) => fee.as_ref(),
287287
TransactionNative::Fee(_, fee) => Some(fee),
288288
};
289289

wasm/src/programs/manager/execute.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ use crate::{
2626
execute_program,
2727
log,
2828
process_inputs,
29+
types::native::{
30+
CurrentAleo,
31+
CurrentNetwork,
32+
IdentifierNative,
33+
ProcessNative,
34+
ProgramNative,
35+
RecordPlaintextNative,
36+
TransactionNative,
37+
},
2938
};
39+
use snarkvm_console::network::{ConsensusVersion, Network};
40+
use snarkvm_ledger_query::QueryTrait;
41+
use snarkvm_synthesizer::prelude::cost_in_microcredits_v1;
3042

31-
use crate::types::native::{
32-
CurrentAleo,
33-
CurrentNetwork,
34-
IdentifierNative,
35-
ProcessNative,
36-
ProgramNative,
37-
RecordPlaintextNative,
38-
TransactionNative,
39-
};
4043
use core::ops::Add;
4144
use js_sys::{Array, Object};
4245
use rand::{SeedableRng, rngs::StdRng};
43-
use snarkvm_console::prelude::Network;
44-
use snarkvm_ledger_query::QueryTrait;
45-
use snarkvm_synthesizer::prelude::cost_in_microcredits_v1;
4646
use std::str::FromStr;
4747

4848
#[wasm_bindgen]
@@ -315,7 +315,7 @@ impl ProgramManager {
315315
let stack = process.get_stack(program_id).map_err(|e| e.to_string())?;
316316

317317
// Calculate the finalize cost for the function identified in the transition
318-
let cost = if block_height >= CurrentNetwork::CONSENSUS_V2_HEIGHT {
318+
let cost = if block_height >= CurrentNetwork::CONSENSUS_HEIGHT(ConsensusVersion::V2).unwrap() {
319319
cost_in_microcredits_v2(stack, function_name).map_err(|e| e.to_string())?
320320
} else {
321321
cost_in_microcredits_v1(stack, function_name).map_err(|e| e.to_string())?

wasm/src/programs/manager/join.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ use crate::{
2525
execute_program,
2626
log,
2727
process_inputs,
28+
types::native::{
29+
CurrentAleo,
30+
IdentifierNative,
31+
ProcessNative,
32+
ProgramNative,
33+
RecordPlaintextNative,
34+
TransactionNative,
35+
},
2836
};
37+
use snarkvm_synthesizer_program::StackKeys;
2938

30-
use crate::types::native::{
31-
CurrentAleo,
32-
IdentifierNative,
33-
ProcessNative,
34-
ProgramNative,
35-
RecordPlaintextNative,
36-
TransactionNative,
37-
};
3839
use js_sys::Array;
3940
use rand::{SeedableRng, rngs::StdRng};
4041
use std::str::FromStr;

wasm/src/programs/manager/mod.rs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,26 @@ pub mod transfer;
2222

2323
const DEFAULT_URL: &str = "https://api.explorer.provable.com/v1";
2424

25-
use crate::{KeyPair, PrivateKey, ProvingKey, RecordPlaintext, VerifyingKey};
26-
27-
use crate::types::native::{
28-
IdentifierNative,
29-
ProcessNative,
30-
ProgramIDNative,
31-
ProgramNative,
32-
ProvingKeyNative,
33-
QueryNative,
34-
VerifyingKeyNative,
35-
cost_in_microcredits_v2,
36-
deployment_cost,
25+
use crate::{
26+
KeyPair,
27+
PrivateKey,
28+
ProvingKey,
29+
RecordPlaintext,
30+
VerifyingKey,
31+
types::native::{
32+
IdentifierNative,
33+
ProcessNative,
34+
ProgramIDNative,
35+
ProgramNative,
36+
ProvingKeyNative,
37+
QueryNative,
38+
VerifyingKeyNative,
39+
cost_in_microcredits_v2,
40+
deployment_cost,
41+
},
3742
};
43+
use snarkvm_synthesizer_program::StackKeys;
44+
3845
use js_sys::{Object, Reflect};
3946
use std::str::FromStr;
4047
use wasm_bindgen::prelude::wasm_bindgen;

wasm/src/programs/manager/split.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616

1717
use super::*;
1818

19-
use crate::{OfflineQuery, PrivateKey, RecordPlaintext, Transaction, execute_program, log, process_inputs};
20-
21-
use crate::types::native::{CurrentAleo, IdentifierNative, ProcessNative, ProgramNative, TransactionNative};
19+
use crate::{
20+
OfflineQuery,
21+
PrivateKey,
22+
RecordPlaintext,
23+
Transaction,
24+
execute_program,
25+
log,
26+
process_inputs,
27+
types::native::{CurrentAleo, IdentifierNative, ProcessNative, ProgramNative, TransactionNative},
28+
};
2229
use js_sys::Array;
2330
use rand::{SeedableRng, rngs::StdRng};
2431
use std::{ops::Add, str::FromStr};

wasm/src/programs/manager/transfer.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ use crate::{
2525
execute_program,
2626
log,
2727
process_inputs,
28+
types::native::{
29+
CurrentAleo,
30+
IdentifierNative,
31+
ProcessNative,
32+
ProgramNative,
33+
RecordPlaintextNative,
34+
TransactionNative,
35+
},
2836
};
37+
use snarkvm_synthesizer_program::StackKeys;
2938

30-
use crate::types::native::{
31-
CurrentAleo,
32-
IdentifierNative,
33-
ProcessNative,
34-
ProgramNative,
35-
RecordPlaintextNative,
36-
TransactionNative,
37-
};
3839
use rand::{SeedableRng, rngs::StdRng};
3940
use std::{ops::Add, str::FromStr};
4041
use wasm_bindgen::JsValue;

0 commit comments

Comments
 (0)