This commit is contained in:
evan-schott 2024-06-25 13:14:25 -07:00
parent 4215c327fd
commit eda937a5b1
15 changed files with 163 additions and 148 deletions

114
Cargo.lock generated
View File

@ -2851,7 +2851,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm" name = "snarkvm"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"anyhow", "anyhow",
@ -2880,7 +2880,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-algorithms" name = "snarkvm-algorithms"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -2910,7 +2910,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit" name = "snarkvm-circuit"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-account", "snarkvm-circuit-account",
"snarkvm-circuit-algorithms", "snarkvm-circuit-algorithms",
@ -2924,7 +2924,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-account" name = "snarkvm-circuit-account"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-algorithms", "snarkvm-circuit-algorithms",
"snarkvm-circuit-network", "snarkvm-circuit-network",
@ -2935,7 +2935,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-algorithms" name = "snarkvm-circuit-algorithms"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-types", "snarkvm-circuit-types",
"snarkvm-console-algorithms", "snarkvm-console-algorithms",
@ -2945,7 +2945,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-collections" name = "snarkvm-circuit-collections"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-algorithms", "snarkvm-circuit-algorithms",
"snarkvm-circuit-types", "snarkvm-circuit-types",
@ -2955,7 +2955,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-environment" name = "snarkvm-circuit-environment"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"itertools 0.11.0", "itertools 0.11.0",
@ -2973,12 +2973,12 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-environment-witness" name = "snarkvm-circuit-environment-witness"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
[[package]] [[package]]
name = "snarkvm-circuit-network" name = "snarkvm-circuit-network"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-algorithms", "snarkvm-circuit-algorithms",
"snarkvm-circuit-collections", "snarkvm-circuit-collections",
@ -2989,7 +2989,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-program" name = "snarkvm-circuit-program"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"paste", "paste",
"snarkvm-circuit-account", "snarkvm-circuit-account",
@ -3004,7 +3004,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types" name = "snarkvm-circuit-types"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-address", "snarkvm-circuit-types-address",
@ -3019,7 +3019,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-address" name = "snarkvm-circuit-types-address"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3032,7 +3032,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-boolean" name = "snarkvm-circuit-types-boolean"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3041,7 +3041,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-field" name = "snarkvm-circuit-types-field"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3051,7 +3051,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-group" name = "snarkvm-circuit-types-group"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3063,7 +3063,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-integers" name = "snarkvm-circuit-types-integers"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3075,7 +3075,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-scalar" name = "snarkvm-circuit-types-scalar"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3086,7 +3086,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-circuit-types-string" name = "snarkvm-circuit-types-string"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-circuit-environment", "snarkvm-circuit-environment",
"snarkvm-circuit-types-boolean", "snarkvm-circuit-types-boolean",
@ -3098,7 +3098,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console" name = "snarkvm-console"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-account", "snarkvm-console-account",
"snarkvm-console-algorithms", "snarkvm-console-algorithms",
@ -3111,7 +3111,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-account" name = "snarkvm-console-account"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"bs58", "bs58",
"snarkvm-console-network", "snarkvm-console-network",
@ -3122,7 +3122,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-algorithms" name = "snarkvm-console-algorithms"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"blake2s_simd", "blake2s_simd",
"smallvec", "smallvec",
@ -3135,7 +3135,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-collections" name = "snarkvm-console-collections"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"rayon", "rayon",
@ -3146,7 +3146,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-network" name = "snarkvm-console-network"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 2.2.6", "indexmap 2.2.6",
@ -3169,7 +3169,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-network-environment" name = "snarkvm-console-network-environment"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bech32", "bech32",
@ -3187,7 +3187,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-program" name = "snarkvm-console-program"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"enum-iterator", "enum-iterator",
"enum_index", "enum_index",
@ -3209,7 +3209,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types" name = "snarkvm-console-types"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-address", "snarkvm-console-types-address",
@ -3224,7 +3224,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-address" name = "snarkvm-console-types-address"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3235,7 +3235,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-boolean" name = "snarkvm-console-types-boolean"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
] ]
@ -3243,7 +3243,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-field" name = "snarkvm-console-types-field"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3253,7 +3253,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-group" name = "snarkvm-console-types-group"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3264,7 +3264,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-integers" name = "snarkvm-console-types-integers"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3275,7 +3275,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-scalar" name = "snarkvm-console-types-scalar"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3286,7 +3286,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-console-types-string" name = "snarkvm-console-types-string"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console-network-environment", "snarkvm-console-network-environment",
"snarkvm-console-types-boolean", "snarkvm-console-types-boolean",
@ -3297,7 +3297,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-curves" name = "snarkvm-curves"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"rand", "rand",
"rayon", "rayon",
@ -3311,7 +3311,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-fields" name = "snarkvm-fields"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3328,7 +3328,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger" name = "snarkvm-ledger"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3352,7 +3352,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-authority" name = "snarkvm-ledger-authority"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"rand", "rand",
@ -3364,7 +3364,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-block" name = "snarkvm-ledger-block"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"rayon", "rayon",
@ -3383,7 +3383,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-committee" name = "snarkvm-ledger-committee"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"rayon", "rayon",
@ -3395,7 +3395,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal" name = "snarkvm-ledger-narwhal"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-certificate",
"snarkvm-ledger-narwhal-batch-header", "snarkvm-ledger-narwhal-batch-header",
@ -3408,7 +3408,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-batch-certificate" name = "snarkvm-ledger-narwhal-batch-certificate"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"rayon", "rayon",
@ -3421,7 +3421,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-batch-header" name = "snarkvm-ledger-narwhal-batch-header"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"rayon", "rayon",
@ -3433,7 +3433,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-data" name = "snarkvm-ledger-narwhal-data"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"bytes", "bytes",
"serde_json", "serde_json",
@ -3444,7 +3444,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-subdag" name = "snarkvm-ledger-narwhal-subdag"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"rayon", "rayon",
@ -3459,7 +3459,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-transmission" name = "snarkvm-ledger-narwhal-transmission"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"bytes", "bytes",
"serde_json", "serde_json",
@ -3472,7 +3472,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-narwhal-transmission-id" name = "snarkvm-ledger-narwhal-transmission-id"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"snarkvm-console", "snarkvm-console",
"snarkvm-ledger-puzzle", "snarkvm-ledger-puzzle",
@ -3481,7 +3481,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-puzzle" name = "snarkvm-ledger-puzzle"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3501,7 +3501,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-puzzle-epoch" name = "snarkvm-ledger-puzzle-epoch"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"colored", "colored",
@ -3516,7 +3516,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-query" name = "snarkvm-ledger-query"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"reqwest 0.11.27", "reqwest 0.11.27",
@ -3529,7 +3529,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-ledger-store" name = "snarkvm-ledger-store"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std-storage", "aleo-std-storage",
"anyhow", "anyhow",
@ -3552,7 +3552,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-parameters" name = "snarkvm-parameters"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3577,7 +3577,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-synthesizer" name = "snarkvm-synthesizer"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3607,7 +3607,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-synthesizer-process" name = "snarkvm-synthesizer-process"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"colored", "colored",
@ -3630,7 +3630,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-synthesizer-program" name = "snarkvm-synthesizer-program"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"paste", "paste",
@ -3644,7 +3644,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-synthesizer-snark" name = "snarkvm-synthesizer-snark"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"bincode", "bincode",
"once_cell", "once_cell",
@ -3657,7 +3657,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-utilities" name = "snarkvm-utilities"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"aleo-std", "aleo-std",
"anyhow", "anyhow",
@ -3678,7 +3678,7 @@ dependencies = [
[[package]] [[package]]
name = "snarkvm-utilities-derives" name = "snarkvm-utilities-derives"
version = "0.16.19" version = "0.16.19"
source = "git+https://github.com/AleoNet/snarkVM.git?rev=6d64025#6d64025f3f775fa164d70d9a8177ec93c97cd36e" source = "git+https://github.com/AleoNet/snarkVM.git?rev=8a05317#8a053177f46dc4383d5a8adcc6b14e4c73f34c82"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote 1.0.36", "quote 1.0.36",

View File

@ -46,7 +46,7 @@ members = [
[workspace.dependencies.snarkvm] [workspace.dependencies.snarkvm]
#version = "0.16.19" #version = "0.16.19"
git = "https://github.com/AleoNet/snarkVM.git" git = "https://github.com/AleoNet/snarkVM.git"
rev = "6d64025" rev = "8a05317"
[lib] [lib]
path = "leo/lib.rs" path = "leo/lib.rs"

View File

@ -138,7 +138,7 @@ pub fn setup_build_directory(
let _manifest_file = Manifest::create(&directory, &program_id).unwrap(); let _manifest_file = Manifest::create(&directory, &program_id).unwrap();
// Create the environment file. // Create the environment file.
Env::<CurrentNetwork>::new(None, endpoint).unwrap().write_to(&directory).unwrap(); Env::<CurrentNetwork>::new(None, endpoint).unwrap().write_to(&directory);
if Env::<CurrentNetwork>::exists_at(&directory) { if Env::<CurrentNetwork>::exists_at(&directory) {
println!(".env file created at {:?}", &directory); println!(".env file created at {:?}", &directory);
} }

View File

@ -267,23 +267,23 @@ create_messages!(
@backtraced @backtraced
failed_to_get_endpoint_from_env { failed_to_get_endpoint_from_env {
args: (command: impl Display), args: (),
msg: "Failed to get an endpoint.".to_string(), msg: "Failed to get an endpoint.".to_string(),
help: Some(format!("Either make sure you have a `.env` file in current project directory with an `ENDPOINT` variable set, or set the `--endpoint` flag when invoking the CLI command.\n Example: `ENDPOINT=https://api.explorer.aleo.org/v1` or `leo {command} --endpoint \"https://api.explorer.aleo.org/v1\"`.")), help: Some("Either make sure you have a `.env` file in current project directory with an `ENDPOINT` variable set, or set the `--endpoint` flag when invoking the CLI command.\n Example: `ENDPOINT=https://api.explorer.aleo.org/v1` or `leo build --endpoint \"https://api.explorer.aleo.org/v1\"`.".to_string()),
} }
@backtraced @backtraced
failed_to_get_private_key_from_env { failed_to_get_private_key_from_env {
args: (command: impl Display), args: (),
msg: "Failed to get a private key.".to_string(), msg: "Failed to get a private key.".to_string(),
help: Some(format!("Either make sure you have a `.env` file in current project directory with a `PRIVATE_KEY` variable set, or set the `--private-key` flag when invoking the CLI command.\n Example: `PRIVATE_KEY=0x1234...` or `leo {command} --private-key \"APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH\"`.")), help: Some("Either make sure you have a `.env` file in current project directory with a `PRIVATE_KEY` variable set, or set the `--private-key` flag when invoking the CLI command.\n Example: `PRIVATE_KEY=0x1234...` or `leo deploy --private-key \"APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH\"`.".to_string()),
} }
@backtraced @backtraced
failed_to_get_network_from_env { failed_to_get_network_from_env {
args: (command: impl Display), args: (),
msg: "Failed to get a network.".to_string(), msg: "Failed to get a network.".to_string(),
help: Some(format!("Either make sure you have a `.env` file in current project directory with a `NETWORK` variable set, or set the `--network` flag when invoking the CLI command.\n Example: `NETWORK=testnet` or `leo {command} --network testnet`.")), help: Some("Either make sure you have a `.env` file in current project directory with a `NETWORK` variable set, or set the `--network` flag when invoking the CLI command.\n Example: `NETWORK=testnet` or `leo build --network testnet`.".to_string()),
} }
@backtraced @backtraced
@ -299,4 +299,12 @@ create_messages!(
msg: format!("Program `{program}` exceeds the variable limit {limit} for deployment on network {network}."), msg: format!("Program `{program}` exceeds the variable limit {limit} for deployment on network {network}."),
help: Some("Reduce the number of variables in the program by reducing the number of instructions in transition functions.".to_string()), help: Some("Reduce the number of variables in the program by reducing the number of instructions in transition functions.".to_string()),
} }
@backtraced
confirmation_failed {
args: (),
msg: "Failed to confirm transaction".to_string(),
help: None,
}
); );

View File

@ -418,4 +418,18 @@ create_messages!(
msg: format!("❌ Execution error: {error}"), msg: format!("❌ Execution error: {error}"),
help: Some("Make sure that you are using the right `--network` options.".to_string()), help: Some("Make sure that you are using the right `--network` options.".to_string()),
} }
@backtraced
snarkvm_error {
args: (error: impl Display),
msg: format!("{error}"),
help: None,
}
@backtraced
failed_to_load_package {
args: (path: impl Display),
msg: format!("Failed to load leo project at path {path}"),
help: Some("Make sure that the path is correct and that the project exists.".to_string()),
}
); );

View File

@ -26,7 +26,7 @@ use crossterm::ExecutableCommand;
use leo_retriever::NetworkName; use leo_retriever::NetworkName;
use rand::SeedableRng; use rand::SeedableRng;
use rand_chacha::ChaChaRng; use rand_chacha::ChaChaRng;
use snarkvm::prelude::{MainnetV0, Network, TestnetV0}; use snarkvm::prelude::{CanaryV0, MainnetV0, Network, TestnetV0};
use std::{ use std::{
io::{self, Read, Write}, io::{self, Read, Write},
path::PathBuf, path::PathBuf,
@ -96,13 +96,6 @@ pub enum Account {
raw: bool, raw: bool,
#[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")] #[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")]
network: String, network: String,
#[clap(
short = 'e',
long,
help = "Endpoint to retrieve network state from.",
default_value = "https://api.explorer.aleo.org/v1"
)]
endpoint: String,
}, },
/// Verify a message from an Aleo address. /// Verify a message from an Aleo address.
Verify { Verify {
@ -120,13 +113,6 @@ pub enum Account {
raw: bool, raw: bool,
#[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")] #[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")]
network: String, network: String,
#[clap(
short = 'e',
long,
help = "Endpoint to retrieve network state from.",
default_value = "https://api.explorer.aleo.org/v1"
)]
endpoint: String,
}, },
} }
@ -152,7 +138,7 @@ impl Command for Account {
match network { match network {
NetworkName::MainnetV0 => generate_new_account::<MainnetV0>(seed, write, discreet, &ctx, endpoint), NetworkName::MainnetV0 => generate_new_account::<MainnetV0>(seed, write, discreet, &ctx, endpoint),
NetworkName::TestnetV0 => generate_new_account::<TestnetV0>(seed, write, discreet, &ctx, endpoint), NetworkName::TestnetV0 => generate_new_account::<TestnetV0>(seed, write, discreet, &ctx, endpoint),
NetworkName::CanaryV0 => generate_new_account::<MainnetV0>(seed, write, discreet, &ctx, endpoint), NetworkName::CanaryV0 => generate_new_account::<CanaryV0>(seed, write, discreet, &ctx, endpoint),
}? }?
} }
Account::Import { private_key, write, discreet, network, endpoint } => { Account::Import { private_key, write, discreet, network, endpoint } => {
@ -161,10 +147,10 @@ impl Command for Account {
match network { match network {
NetworkName::MainnetV0 => import_account::<MainnetV0>(private_key, write, discreet, &ctx, endpoint), NetworkName::MainnetV0 => import_account::<MainnetV0>(private_key, write, discreet, &ctx, endpoint),
NetworkName::TestnetV0 => import_account::<TestnetV0>(private_key, write, discreet, &ctx, endpoint), NetworkName::TestnetV0 => import_account::<TestnetV0>(private_key, write, discreet, &ctx, endpoint),
NetworkName::CanaryV0 => import_account::<MainnetV0>(private_key, write, discreet, &ctx, endpoint), NetworkName::CanaryV0 => import_account::<CanaryV0>(private_key, write, discreet, &ctx, endpoint),
}? }?
} }
Self::Sign { message, seed, raw, private_key, private_key_file, network, endpoint: _ } => { Self::Sign { message, seed, raw, private_key, private_key_file, network } => {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(network.as_str())?; let network = NetworkName::try_from(network.as_str())?;
let result = match network { let result = match network {
@ -180,13 +166,13 @@ impl Command for Account {
}?; }?;
println!("{result}") println!("{result}")
} }
Self::Verify { address, signature, message, raw, network, endpoint: _ } => { Self::Verify { address, signature, message, raw, network } => {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(network.as_str())?; let network = NetworkName::try_from(network.as_str())?;
let result = match network { let result = match network {
NetworkName::MainnetV0 => verify_message::<MainnetV0>(address, signature, message, raw), NetworkName::MainnetV0 => verify_message::<MainnetV0>(address, signature, message, raw),
NetworkName::TestnetV0 => verify_message::<TestnetV0>(address, signature, message, raw), NetworkName::TestnetV0 => verify_message::<TestnetV0>(address, signature, message, raw),
NetworkName::CanaryV0 => verify_message::<MainnetV0>(address, signature, message, raw), NetworkName::CanaryV0 => verify_message::<CanaryV0>(address, signature, message, raw),
}?; }?;
println!("{result}") println!("{result}")
} }

View File

@ -29,6 +29,7 @@ use snarkvm::{
}; };
use indexmap::IndexMap; use indexmap::IndexMap;
use snarkvm::prelude::CanaryV0;
use std::{ use std::{
io::Write, io::Write,
path::{Path, PathBuf}, path::{Path, PathBuf},
@ -93,11 +94,11 @@ impl Command for Build {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(context.get_network(&self.options.network, "build")?)?; let network = NetworkName::try_from(context.get_network(&self.options.network)?)?;
match network { match network {
NetworkName::MainnetV0 => handle_build::<MainnetV0>(&self, context), NetworkName::MainnetV0 => handle_build::<MainnetV0>(&self, context),
NetworkName::TestnetV0 => handle_build::<TestnetV0>(&self, context), NetworkName::TestnetV0 => handle_build::<TestnetV0>(&self, context),
NetworkName::CanaryV0 => handle_build::<MainnetV0>(&self, context), NetworkName::CanaryV0 => handle_build::<CanaryV0>(&self, context),
} }
} }
} }
@ -128,7 +129,7 @@ fn handle_build<N: Network>(command: &Build, context: Context) -> Result<<Build
main_sym, main_sym,
&package_path, &package_path,
&home_path, &home_path,
context.get_endpoint(&command.options.endpoint, "build")?.to_string(), context.get_endpoint(&command.options.endpoint)?.to_string(),
) )
.map_err(|err| UtilError::failed_to_retrieve_dependencies(err, Default::default()))?; .map_err(|err| UtilError::failed_to_retrieve_dependencies(err, Default::default()))?;
let mut local_dependencies = let mut local_dependencies =

View File

@ -19,12 +19,13 @@ use aleo_std::StorageMode;
use dialoguer::{theme::ColorfulTheme, Confirm}; use dialoguer::{theme::ColorfulTheme, Confirm};
use leo_retriever::NetworkName; use leo_retriever::NetworkName;
use snarkvm::{ use snarkvm::{
circuit::{Aleo, AleoTestnetV0, AleoV0}, circuit::{Aleo, AleoCanaryV0, AleoTestnetV0, AleoV0},
ledger::query::Query as SnarkVMQuery, ledger::query::Query as SnarkVMQuery,
package::Package as SnarkVMPackage, package::Package as SnarkVMPackage,
prelude::{ prelude::{
deployment_cost, deployment_cost,
store::{helpers::memory::ConsensusMemory, ConsensusStore}, store::{helpers::memory::ConsensusMemory, ConsensusStore},
CanaryV0,
MainnetV0, MainnetV0,
ProgramOwner, ProgramOwner,
TestnetV0, TestnetV0,
@ -70,12 +71,12 @@ impl Command for Deploy {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(context.get_network(&self.options.network, "deploy")?)?; let network = NetworkName::try_from(context.get_network(&self.options.network)?)?;
let endpoint = context.get_endpoint(&self.options.endpoint, "deploy")?; let endpoint = context.get_endpoint(&self.options.endpoint)?;
match network { match network {
NetworkName::MainnetV0 => handle_deploy::<AleoV0, MainnetV0>(&self, context, network, &endpoint), NetworkName::MainnetV0 => handle_deploy::<AleoV0, MainnetV0>(&self, context, network, &endpoint),
NetworkName::TestnetV0 => handle_deploy::<AleoTestnetV0, TestnetV0>(&self, context, network, &endpoint), NetworkName::TestnetV0 => handle_deploy::<AleoTestnetV0, TestnetV0>(&self, context, network, &endpoint),
NetworkName::CanaryV0 => handle_deploy::<AleoV0, MainnetV0>(&self, context, network, &endpoint), NetworkName::CanaryV0 => handle_deploy::<AleoCanaryV0, CanaryV0>(&self, context, network, &endpoint),
} }
} }
} }
@ -91,7 +92,7 @@ fn handle_deploy<A: Aleo<Network = N, BaseField = N::Field>, N: Network>(
let project_name = context.open_manifest::<N>()?.program_id().to_string(); let project_name = context.open_manifest::<N>()?.program_id().to_string();
// Get the private key. // Get the private key.
let private_key = context.get_private_key(&command.fee_options.private_key, "deploy")?; let private_key = context.get_private_key(&command.fee_options.private_key)?;
let address = Address::try_from(&private_key)?; let address = Address::try_from(&private_key)?;
// Specify the query // Specify the query
@ -192,14 +193,17 @@ fn handle_deploy<A: Aleo<Network = N, BaseField = N::Field>, N: Network>(
"Do you want to submit deployment of program `{name}.aleo` to network {} via endpoint {} using address {}?", "Do you want to submit deployment of program `{name}.aleo` to network {} via endpoint {} using address {}?",
network, endpoint, address network, endpoint, address
); );
let confirmation = Confirm::with_theme(&ColorfulTheme::default()) let confirmation =
.with_prompt(prompt) Confirm::with_theme(&ColorfulTheme::default()).with_prompt(prompt).default(false).interact();
.default(false)
.interact() // Check if the user confirmed the transaction.
.unwrap(); if let Ok(confirmation) = confirmation {
if !confirmation { if !confirmation {
println!("✅ Successfully aborted the execution transaction for '{}'\n", name.bold()); println!("✅ Successfully aborted the execution transaction for '{}'\n", name.bold());
return Ok(()); return Ok(());
}
} else {
return Err(CliError::confirmation_failed().into());
} }
} }
println!("✅ Created deployment transaction for '{}'\n", name.bold()); println!("✅ Created deployment transaction for '{}'\n", name.bold());

View File

@ -27,7 +27,7 @@ use crate::cli::query::QueryCommands;
use dialoguer::{theme::ColorfulTheme, Confirm}; use dialoguer::{theme::ColorfulTheme, Confirm};
use leo_retriever::NetworkName; use leo_retriever::NetworkName;
use snarkvm::{ use snarkvm::{
circuit::{Aleo, AleoTestnetV0, AleoV0}, circuit::{Aleo, AleoCanaryV0, AleoTestnetV0, AleoV0},
cli::LOCALE, cli::LOCALE,
ledger::Transaction::Execute as ExecuteTransaction, ledger::Transaction::Execute as ExecuteTransaction,
package::Package as SnarkVMPackage, package::Package as SnarkVMPackage,
@ -87,12 +87,12 @@ impl Command for Execute {
fn apply(self, context: Context, _input: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _input: Self::Input) -> Result<Self::Output> {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(context.get_network(&self.compiler_options.network, "deploy")?)?; let network = NetworkName::try_from(context.get_network(&self.compiler_options.network)?)?;
let endpoint = context.get_endpoint(&self.compiler_options.endpoint, "deploy")?; let endpoint = context.get_endpoint(&self.compiler_options.endpoint)?;
match network { match network {
NetworkName::MainnetV0 => handle_execute::<AleoV0>(self, context, network, &endpoint), NetworkName::MainnetV0 => handle_execute::<AleoV0>(self, context, network, &endpoint),
NetworkName::TestnetV0 => handle_execute::<AleoTestnetV0>(self, context, network, &endpoint), NetworkName::TestnetV0 => handle_execute::<AleoTestnetV0>(self, context, network, &endpoint),
NetworkName::CanaryV0 => handle_execute::<AleoV0>(self, context, network, &endpoint), NetworkName::CanaryV0 => handle_execute::<AleoCanaryV0>(self, context, network, &endpoint),
} }
} }
} }
@ -221,14 +221,18 @@ fn handle_execute<A: Aleo>(
"Do you want to submit execution of function `{}` on program `{program_name}.aleo` to network {} via endpoint {} using address {}?", "Do you want to submit execution of function `{}` on program `{program_name}.aleo` to network {} via endpoint {} using address {}?",
&command.name, network, endpoint, address &command.name, network, endpoint, address
); );
let confirmation = Confirm::with_theme(&ColorfulTheme::default()) // Ask the user for confirmation of the transaction.
.with_prompt(prompt) let confirmation =
.default(false) Confirm::with_theme(&ColorfulTheme::default()).with_prompt(prompt).default(false).interact();
.interact()
.unwrap(); // Check if the user confirmed the transaction.
if !confirmation { if let Ok(confirmation) = confirmation {
println!("✅ Successfully aborted the execution transaction for '{}'\n", program_name.bold()); if !confirmation {
return Ok(()); println!("✅ Successfully aborted the execution transaction for '{}'\n", program_name.bold());
return Ok(());
}
} else {
return Err(CliError::confirmation_failed().into());
} }
} }
println!("✅ Created execution transaction for '{}'\n", program_id.to_string().bold()); println!("✅ Created execution transaction for '{}'\n", program_id.to_string().bold());
@ -250,7 +254,10 @@ fn handle_execute<A: Aleo>(
// Load the package. // Load the package.
let package = SnarkVMPackage::open(&path)?; let package = SnarkVMPackage::open(&path)?;
// Convert the inputs. // Convert the inputs.
let inputs = inputs.iter().map(|input| Value::from_str(input).unwrap()).collect::<Vec<Value<A::Network>>>(); let inputs = inputs
.iter()
.map(|input| Value::from_str(input).map_err(PackageError::snarkvm_error).unwrap())
.collect::<Vec<Value<A::Network>>>();
// Execute the request. // Execute the request.
let (response, execution, metrics) = package let (response, execution, metrics) = package
.execute::<A, _>(endpoint.to_string(), &private_key, Identifier::try_from(command.name.clone())?, &inputs, rng) .execute::<A, _>(endpoint.to_string(), &private_key, Identifier::try_from(command.name.clone())?, &inputs, rng)
@ -332,11 +339,7 @@ fn load_program_from_network<N: Network>(
endpoint: Some(endpoint.to_string()), endpoint: Some(endpoint.to_string()),
network: Some(network.to_string()), network: Some(network.to_string()),
command: QueryCommands::Program { command: QueryCommands::Program {
command: crate::cli::commands::query::Program { command: query::Program { name: program_id.to_string(), mappings: false, mapping_value: None },
name: program_id.to_string(),
mappings: false,
mapping_value: None,
},
}, },
} }
.execute(Context::new(context.path.clone(), context.home.clone(), true)?)?; .execute(Context::new(context.path.clone(), context.home.clone(), true)?)?;
@ -377,5 +380,5 @@ fn execution_cost_breakdown(name: &String, total_cost: f64, storage_cost: f64, f
]; ];
let mut out = Vec::new(); let mut out = Vec::new();
text_tables::render(&mut out, data).unwrap(); text_tables::render(&mut out, data).unwrap();
println!("{}", ::std::str::from_utf8(&out).unwrap()); println!("{}", std::str::from_utf8(&out).unwrap());
} }

View File

@ -261,8 +261,9 @@ fn check_balance<N: Network>(
.execute(Context::new(context.path.clone(), context.home.clone(), true)?)?; .execute(Context::new(context.path.clone(), context.home.clone(), true)?)?;
// Remove the last 3 characters since they represent the `u64` suffix. // Remove the last 3 characters since they represent the `u64` suffix.
public_balance.truncate(public_balance.len() - 3); public_balance.truncate(public_balance.len() - 3);
// Compare balance. // This unwrap is safe as the Query will error if it cannot retrieve a public balance, and if it returns a balance that will be a u64.
let balance = public_balance.parse::<u64>().unwrap(); let balance = public_balance.parse::<u64>().unwrap();
// Compare balance.
if balance < total_cost { if balance < total_cost {
Err(PackageError::insufficient_balance(address, public_balance, total_cost).into()) Err(PackageError::insufficient_balance(address, public_balance, total_cost).into())
} else { } else {

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use super::*; use super::*;
use snarkvm::prelude::{MainnetV0, TestnetV0}; use snarkvm::prelude::{CanaryV0, MainnetV0, TestnetV0};
use leo_retriever::NetworkName; use leo_retriever::NetworkName;
@ -62,7 +62,7 @@ impl Command for New {
match network { match network {
NetworkName::MainnetV0 => Package::initialize::<MainnetV0>(&self.name, &package_path, self.endpoint), NetworkName::MainnetV0 => Package::initialize::<MainnetV0>(&self.name, &package_path, self.endpoint),
NetworkName::TestnetV0 => Package::initialize::<TestnetV0>(&self.name, &package_path, self.endpoint), NetworkName::TestnetV0 => Package::initialize::<TestnetV0>(&self.name, &package_path, self.endpoint),
NetworkName::CanaryV0 => Package::initialize::<TestnetV0>(&self.name, &package_path, self.endpoint), NetworkName::CanaryV0 => Package::initialize::<CanaryV0>(&self.name, &package_path, self.endpoint),
}?; }?;
Ok(()) Ok(())

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>. // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use super::*; use super::*;
use snarkvm::prelude::{MainnetV0, TestnetV0}; use snarkvm::prelude::{CanaryV0, MainnetV0, TestnetV0};
mod block; mod block;
use block::Block; use block::Block;
@ -69,12 +69,12 @@ impl Command for Query {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(context.get_network(&self.network, "query")?)?; let network = NetworkName::try_from(context.get_network(&self.network)?)?;
let endpoint = context.get_endpoint(&self.endpoint, "query")?; let endpoint = context.get_endpoint(&self.endpoint)?;
match network { match network {
NetworkName::MainnetV0 => handle_query::<MainnetV0>(self, context, &network.to_string(), &endpoint), NetworkName::MainnetV0 => handle_query::<MainnetV0>(self, context, &network.to_string(), &endpoint),
NetworkName::TestnetV0 => handle_query::<TestnetV0>(self, context, &network.to_string(), &endpoint), NetworkName::TestnetV0 => handle_query::<TestnetV0>(self, context, &network.to_string(), &endpoint),
NetworkName::CanaryV0 => handle_query::<MainnetV0>(self, context, &network.to_string(), &endpoint), NetworkName::CanaryV0 => handle_query::<CanaryV0>(self, context, &network.to_string(), &endpoint),
} }
} }
} }

View File

@ -19,7 +19,7 @@ use super::*;
use leo_retriever::NetworkName; use leo_retriever::NetworkName;
use snarkvm::{ use snarkvm::{
cli::Run as SnarkVMRun, cli::Run as SnarkVMRun,
prelude::{MainnetV0, Network, Parser as SnarkVMParser, TestnetV0}, prelude::{CanaryV0, MainnetV0, Network, Parser as SnarkVMParser, TestnetV0},
}; };
/// Build, Prove and Run Leo program with inputs /// Build, Prove and Run Leo program with inputs
@ -52,11 +52,11 @@ impl Command for Run {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network. // Parse the network.
let network = NetworkName::try_from(context.get_network(&self.compiler_options.network, "run")?)?; let network = NetworkName::try_from(context.get_network(&self.compiler_options.network)?)?;
match network { match network {
NetworkName::MainnetV0 => handle_run::<MainnetV0>(self, context), NetworkName::MainnetV0 => handle_run::<MainnetV0>(self, context),
NetworkName::TestnetV0 => handle_run::<TestnetV0>(self, context), NetworkName::TestnetV0 => handle_run::<TestnetV0>(self, context),
NetworkName::CanaryV0 => handle_run::<TestnetV0>(self, context), NetworkName::CanaryV0 => handle_run::<CanaryV0>(self, context),
} }
} }
} }

View File

@ -143,54 +143,52 @@ impl Context {
} }
/// Returns the private key from the .env file specified in the directory. /// Returns the private key from the .env file specified in the directory.
pub fn dotenv_private_key<N: Network>(&self, command: &str) -> Result<PrivateKey<N>> { pub fn dotenv_private_key<N: Network>(&self) -> Result<PrivateKey<N>> {
dotenvy::from_path(self.dir()?.join(".env")) dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_private_key_from_env())?;
.map_err(|_| CliError::failed_to_get_private_key_from_env(command))?;
// Load the private key from the environment. // Load the private key from the environment.
let private_key = let private_key = dotenvy::var("PRIVATE_KEY").map_err(|_| CliError::failed_to_get_private_key_from_env())?;
dotenvy::var("PRIVATE_KEY").map_err(|_| CliError::failed_to_get_private_key_from_env(command))?;
// Parse the private key. // Parse the private key.
Ok(PrivateKey::<N>::from_str(&private_key)?) Ok(PrivateKey::<N>::from_str(&private_key)?)
} }
/// Returns the endpoint from the .env file specified in the directory. /// Returns the endpoint from the .env file specified in the directory.
pub fn dotenv_endpoint(&self, command: &str) -> Result<String> { pub fn dotenv_endpoint(&self) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_endpoint_from_env(command))?; dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_endpoint_from_env())?;
// Load the endpoint from the environment. // Load the endpoint from the environment.
Ok(dotenvy::var("ENDPOINT").map_err(|_| CliError::failed_to_get_endpoint_from_env(command))?) Ok(dotenvy::var("ENDPOINT").map_err(|_| CliError::failed_to_get_endpoint_from_env())?)
} }
/// Returns the network from the .env file specified in the directory. /// Returns the network from the .env file specified in the directory.
pub fn dotenv_network(&self, command: &str) -> Result<String> { pub fn dotenv_network(&self) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_network_from_env(command))?; dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_network_from_env())?;
// Load the network from the environment. // Load the network from the environment.
Ok(dotenvy::var("NETWORK").map_err(|_| CliError::failed_to_get_network_from_env(command))?) Ok(dotenvy::var("NETWORK").map_err(|_| CliError::failed_to_get_network_from_env())?)
} }
/// Returns the endpoint to interact with the network. /// Returns the endpoint to interact with the network.
/// If the `--endpoint` options is not provided, it will default to the one in the `.env` file. /// If the `--endpoint` options is not provided, it will default to the one in the `.env` file.
pub fn get_endpoint(&self, endpoint: &Option<String>, command: &str) -> Result<String> { pub fn get_endpoint(&self, endpoint: &Option<String>) -> Result<String> {
match endpoint { match endpoint {
Some(endpoint) => Ok(endpoint.clone()), Some(endpoint) => Ok(endpoint.clone()),
None => Ok(self.dotenv_endpoint(command)?), None => Ok(self.dotenv_endpoint()?),
} }
} }
/// Returns the network name. /// Returns the network name.
/// If the `--network` options is not provided, it will default to the one in the `.env` file. /// If the `--network` options is not provided, it will default to the one in the `.env` file.
pub fn get_network(&self, network: &Option<String>, command: &str) -> Result<String> { pub fn get_network(&self, network: &Option<String>) -> Result<String> {
match network { match network {
Some(network) => Ok(network.clone()), Some(network) => Ok(network.clone()),
None => Ok(self.dotenv_network(command)?), None => Ok(self.dotenv_network()?),
} }
} }
/// Returns the private key. /// Returns the private key.
/// If the `--private-key` options is not provided, it will default to the one in the `.env` file. /// If the `--private-key` options is not provided, it will default to the one in the `.env` file.
pub fn get_private_key<N: Network>(&self, private_key: &Option<String>, command: &str) -> Result<PrivateKey<N>> { pub fn get_private_key<N: Network>(&self, private_key: &Option<String>) -> Result<PrivateKey<N>> {
match private_key { match private_key {
Some(private_key) => Ok(PrivateKey::<N>::from_str(private_key)?), Some(private_key) => Ok(PrivateKey::<N>::from_str(private_key)?),
None => self.dotenv_private_key(command), None => self.dotenv_private_key(),
} }
} }
} }

View File

@ -87,7 +87,7 @@ impl Manifest {
pub fn read_from_dir(path: &Path) -> Result<Self, PackageError> { pub fn read_from_dir(path: &Path) -> Result<Self, PackageError> {
// Read the manifest file. // Read the manifest file.
let contents = std::fs::read_to_string(path.join("program.json")) let contents = std::fs::read_to_string(path.join("program.json"))
.map_err(|err| PackageError::failed_to_read_file(path.to_str().unwrap(), err))?; .map_err(|_| PackageError::failed_to_load_package(path.to_str().unwrap()))?;
// Deserialize the manifest. // Deserialize the manifest.
serde_json::from_str(&contents) serde_json::from_str(&contents)
.map_err(|err| PackageError::failed_to_deserialize_manifest_file(path.to_str().unwrap(), err)) .map_err(|err| PackageError::failed_to_deserialize_manifest_file(path.to_str().unwrap(), err))