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

View File

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

View File

@ -138,7 +138,7 @@ pub fn setup_build_directory(
let _manifest_file = Manifest::create(&directory, &program_id).unwrap();
// 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) {
println!(".env file created at {:?}", &directory);
}

View File

@ -267,23 +267,23 @@ create_messages!(
@backtraced
failed_to_get_endpoint_from_env {
args: (command: impl Display),
args: (),
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
failed_to_get_private_key_from_env {
args: (command: impl Display),
args: (),
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
failed_to_get_network_from_env {
args: (command: impl Display),
args: (),
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
@ -299,4 +299,12 @@ create_messages!(
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()),
}
@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}"),
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 rand::SeedableRng;
use rand_chacha::ChaChaRng;
use snarkvm::prelude::{MainnetV0, Network, TestnetV0};
use snarkvm::prelude::{CanaryV0, MainnetV0, Network, TestnetV0};
use std::{
io::{self, Read, Write},
path::PathBuf,
@ -96,13 +96,6 @@ pub enum Account {
raw: bool,
#[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")]
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 {
@ -120,13 +113,6 @@ pub enum Account {
raw: bool,
#[clap(short = 'n', long, help = "Name of the network to use", default_value = "mainnet")]
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 {
NetworkName::MainnetV0 => generate_new_account::<MainnetV0>(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 } => {
@ -161,10 +147,10 @@ impl Command for Account {
match network {
NetworkName::MainnetV0 => import_account::<MainnetV0>(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.
let network = NetworkName::try_from(network.as_str())?;
let result = match network {
@ -180,13 +166,13 @@ impl Command for Account {
}?;
println!("{result}")
}
Self::Verify { address, signature, message, raw, network, endpoint: _ } => {
Self::Verify { address, signature, message, raw, network } => {
// Parse the network.
let network = NetworkName::try_from(network.as_str())?;
let result = match network {
NetworkName::MainnetV0 => verify_message::<MainnetV0>(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}")
}

View File

@ -29,6 +29,7 @@ use snarkvm::{
};
use indexmap::IndexMap;
use snarkvm::prelude::CanaryV0;
use std::{
io::Write,
path::{Path, PathBuf},
@ -93,11 +94,11 @@ impl Command for Build {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// 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 {
NetworkName::MainnetV0 => handle_build::<MainnetV0>(&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,
&package_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()))?;
let mut local_dependencies =

View File

@ -19,12 +19,13 @@ use aleo_std::StorageMode;
use dialoguer::{theme::ColorfulTheme, Confirm};
use leo_retriever::NetworkName;
use snarkvm::{
circuit::{Aleo, AleoTestnetV0, AleoV0},
circuit::{Aleo, AleoCanaryV0, AleoTestnetV0, AleoV0},
ledger::query::Query as SnarkVMQuery,
package::Package as SnarkVMPackage,
prelude::{
deployment_cost,
store::{helpers::memory::ConsensusMemory, ConsensusStore},
CanaryV0,
MainnetV0,
ProgramOwner,
TestnetV0,
@ -70,12 +71,12 @@ impl Command for Deploy {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network.
let network = NetworkName::try_from(context.get_network(&self.options.network, "deploy")?)?;
let endpoint = context.get_endpoint(&self.options.endpoint, "deploy")?;
let network = NetworkName::try_from(context.get_network(&self.options.network)?)?;
let endpoint = context.get_endpoint(&self.options.endpoint)?;
match network {
NetworkName::MainnetV0 => handle_deploy::<AleoV0, MainnetV0>(&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();
// 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)?;
// 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 {}?",
network, endpoint, address
);
let confirmation = Confirm::with_theme(&ColorfulTheme::default())
.with_prompt(prompt)
.default(false)
.interact()
.unwrap();
if !confirmation {
println!("✅ Successfully aborted the execution transaction for '{}'\n", name.bold());
return Ok(());
let confirmation =
Confirm::with_theme(&ColorfulTheme::default()).with_prompt(prompt).default(false).interact();
// Check if the user confirmed the transaction.
if let Ok(confirmation) = confirmation {
if !confirmation {
println!("✅ Successfully aborted the execution transaction for '{}'\n", name.bold());
return Ok(());
}
} else {
return Err(CliError::confirmation_failed().into());
}
}
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 leo_retriever::NetworkName;
use snarkvm::{
circuit::{Aleo, AleoTestnetV0, AleoV0},
circuit::{Aleo, AleoCanaryV0, AleoTestnetV0, AleoV0},
cli::LOCALE,
ledger::Transaction::Execute as ExecuteTransaction,
package::Package as SnarkVMPackage,
@ -87,12 +87,12 @@ impl Command for Execute {
fn apply(self, context: Context, _input: Self::Input) -> Result<Self::Output> {
// Parse the network.
let network = NetworkName::try_from(context.get_network(&self.compiler_options.network, "deploy")?)?;
let endpoint = context.get_endpoint(&self.compiler_options.endpoint, "deploy")?;
let network = NetworkName::try_from(context.get_network(&self.compiler_options.network)?)?;
let endpoint = context.get_endpoint(&self.compiler_options.endpoint)?;
match network {
NetworkName::MainnetV0 => handle_execute::<AleoV0>(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 {}?",
&command.name, network, endpoint, address
);
let confirmation = Confirm::with_theme(&ColorfulTheme::default())
.with_prompt(prompt)
.default(false)
.interact()
.unwrap();
if !confirmation {
println!("✅ Successfully aborted the execution transaction for '{}'\n", program_name.bold());
return Ok(());
// Ask the user for confirmation of the transaction.
let confirmation =
Confirm::with_theme(&ColorfulTheme::default()).with_prompt(prompt).default(false).interact();
// Check if the user confirmed the transaction.
if let Ok(confirmation) = confirmation {
if !confirmation {
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());
@ -250,7 +254,10 @@ fn handle_execute<A: Aleo>(
// Load the package.
let package = SnarkVMPackage::open(&path)?;
// 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.
let (response, execution, metrics) = package
.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()),
network: Some(network.to_string()),
command: QueryCommands::Program {
command: crate::cli::commands::query::Program {
name: program_id.to_string(),
mappings: false,
mapping_value: None,
},
command: query::Program { name: program_id.to_string(), mappings: false, mapping_value: None },
},
}
.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();
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)?)?;
// Remove the last 3 characters since they represent the `u64` suffix.
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();
// Compare balance.
if balance < total_cost {
Err(PackageError::insufficient_balance(address, public_balance, total_cost).into())
} else {

View File

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

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use super::*;
use snarkvm::prelude::{MainnetV0, TestnetV0};
use snarkvm::prelude::{CanaryV0, MainnetV0, TestnetV0};
mod block;
use block::Block;
@ -69,12 +69,12 @@ impl Command for Query {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Parse the network.
let network = NetworkName::try_from(context.get_network(&self.network, "query")?)?;
let endpoint = context.get_endpoint(&self.endpoint, "query")?;
let network = NetworkName::try_from(context.get_network(&self.network)?)?;
let endpoint = context.get_endpoint(&self.endpoint)?;
match network {
NetworkName::MainnetV0 => handle_query::<MainnetV0>(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 snarkvm::{
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
@ -52,11 +52,11 @@ impl Command for Run {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// 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 {
NetworkName::MainnetV0 => handle_run::<MainnetV0>(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.
pub fn dotenv_private_key<N: Network>(&self, command: &str) -> Result<PrivateKey<N>> {
dotenvy::from_path(self.dir()?.join(".env"))
.map_err(|_| CliError::failed_to_get_private_key_from_env(command))?;
pub fn dotenv_private_key<N: Network>(&self) -> Result<PrivateKey<N>> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_private_key_from_env())?;
// Load the private key from the environment.
let private_key =
dotenvy::var("PRIVATE_KEY").map_err(|_| CliError::failed_to_get_private_key_from_env(command))?;
let private_key = dotenvy::var("PRIVATE_KEY").map_err(|_| CliError::failed_to_get_private_key_from_env())?;
// Parse the private key.
Ok(PrivateKey::<N>::from_str(&private_key)?)
}
/// Returns the endpoint from the .env file specified in the directory.
pub fn dotenv_endpoint(&self, command: &str) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_endpoint_from_env(command))?;
pub fn dotenv_endpoint(&self) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_endpoint_from_env())?;
// 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.
pub fn dotenv_network(&self, command: &str) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_network_from_env(command))?;
pub fn dotenv_network(&self) -> Result<String> {
dotenvy::from_path(self.dir()?.join(".env")).map_err(|_| CliError::failed_to_get_network_from_env())?;
// 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.
/// 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 {
Some(endpoint) => Ok(endpoint.clone()),
None => Ok(self.dotenv_endpoint(command)?),
None => Ok(self.dotenv_endpoint()?),
}
}
/// Returns the network name.
/// 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 {
Some(network) => Ok(network.clone()),
None => Ok(self.dotenv_network(command)?),
None => Ok(self.dotenv_network()?),
}
}
/// Returns the private key.
/// 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 {
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> {
// Read the manifest file.
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.
serde_json::from_str(&contents)
.map_err(|err| PackageError::failed_to_deserialize_manifest_file(path.to_str().unwrap(), err))