mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-28 09:02:58 +03:00
commit
9f8bdb2d7e
@ -26,7 +26,7 @@ use crate::{
|
||||
GroupType,
|
||||
Integer,
|
||||
};
|
||||
use leo_typed::{Circuit, Function, Identifier, Span, Type};
|
||||
use leo_typed::{Circuit, Function, GroupValue, Identifier, Span, Type};
|
||||
|
||||
use snarkos_errors::gadgets::SynthesisError;
|
||||
use snarkos_models::{
|
||||
@ -85,7 +85,7 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedValue<F, G> {
|
||||
Type::Address => Ok(ConstrainedValue::Address(Address::new(value, span)?)),
|
||||
Type::Boolean => Ok(ConstrainedValue::Boolean(new_bool_constant(value, span)?)),
|
||||
Type::Field => Ok(ConstrainedValue::Field(FieldType::constant(value, span)?)),
|
||||
Type::Group => Err(ValueError::implicit_group(span)),
|
||||
Type::Group => Ok(ConstrainedValue::Group(G::constant(GroupValue::Single(value, span))?)),
|
||||
Type::IntegerType(integer_type) => Ok(ConstrainedValue::Integer(Integer::new_constant(
|
||||
integer_type,
|
||||
value,
|
||||
|
@ -1,3 +1,6 @@
|
||||
[package]
|
||||
name = "fibonacci"
|
||||
version = "0.1.0"
|
||||
description = "Returns a fibonnaci sequence"
|
||||
remote = "aleo/fibonacci"
|
||||
license = "LICENSE-MIT"
|
||||
|
6
examples/hello-world/Leo.toml
Normal file
6
examples/hello-world/Leo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "hello-world"
|
||||
version = "0.1.0"
|
||||
description = "Returns the sum of two u32 integers"
|
||||
remote = "aleo/hello-world"
|
||||
license = "LICENSE-MIT"
|
6
examples/hello-world/inputs/hello-world.in
Normal file
6
examples/hello-world/inputs/hello-world.in
Normal file
@ -0,0 +1,6 @@
|
||||
[main]
|
||||
a: u32 = 1;
|
||||
b: u32 = 2;
|
||||
|
||||
[registers]
|
||||
r0: u32 = 0;
|
5
examples/hello-world/src/main.leo
Normal file
5
examples/hello-world/src/main.leo
Normal file
@ -0,0 +1,5 @@
|
||||
// The 'hello-world' main function.
|
||||
function main(a: u32, b: u32) -> u32 {
|
||||
let c: u32 = a + b;
|
||||
return c
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
[package]
|
||||
name = "hello_world"
|
||||
version = "0.1.0"
|
@ -1,2 +0,0 @@
|
||||
[registers]
|
||||
r0: u32 = 0;
|
@ -1,5 +0,0 @@
|
||||
// The 'hello_world' main function.
|
||||
function main() -> u32 {
|
||||
let a: u32 = 1 + 1;
|
||||
return a
|
||||
}
|
6
examples/pedersen-hash/Leo.toml
Normal file
6
examples/pedersen-hash/Leo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "pedersen-hash"
|
||||
version = "0.1.0"
|
||||
description = "A 256bit hash function"
|
||||
remote = "aleo/pedersen-hash"
|
||||
license = "LICENSE-MIT"
|
@ -17,7 +17,7 @@ circuit PedersenHash {
|
||||
}
|
||||
}
|
||||
|
||||
// The 'pedersen_hash' main function.
|
||||
// The 'pedersen-hash' main function.
|
||||
function main() -> group {
|
||||
const parameters = [1group; 256];
|
||||
const pedersen = PedersenHash::new(parameters);
|
@ -1,3 +0,0 @@
|
||||
[package]
|
||||
name = "pedersen_hash"
|
||||
version = "0.1.0"
|
6
examples/square-root/Leo.toml
Normal file
6
examples/square-root/Leo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "square-root"
|
||||
version = "0.1.0"
|
||||
description = "prove knowledge of the square root `a` of a number `b`"
|
||||
remote = "aleo/square-root"
|
||||
license = "LICENSE-MIT"
|
@ -1,7 +1,7 @@
|
||||
// The program input for square_root/src/main.leo
|
||||
[main]
|
||||
a: field = 337;
|
||||
b: field = 113569;
|
||||
a: u32 = 337;
|
||||
b: u32 = 113569;
|
||||
|
||||
[registers]
|
||||
r0: bool = false;
|
5
examples/square-root/src/main.leo
Normal file
5
examples/square-root/src/main.leo
Normal file
@ -0,0 +1,5 @@
|
||||
// The 'square-root' main function.
|
||||
// prove knowledge of the square root `a` of a number `b`
|
||||
function main(a: u32, b: u32) -> bool {
|
||||
return a * a == b
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
[package]
|
||||
name = "square_root"
|
||||
version = "0.1.0"
|
@ -1,5 +0,0 @@
|
||||
// The 'square_root' main function.
|
||||
// prove knowledge of the square root `a` of a number `b`:
|
||||
function main(a: field, b: field) -> bool {
|
||||
return a * a == b
|
||||
}
|
@ -118,7 +118,7 @@ impl CLI for PublishCommand {
|
||||
|
||||
// If not logged in, then try logging in using JWT.
|
||||
Err(_error) => {
|
||||
log::warn!("You should be logged before publish the package");
|
||||
log::warn!("You should be logged in before attempting to publish a package");
|
||||
log::info!("Trying to log in using JWT...");
|
||||
let options = (None, None, None);
|
||||
|
||||
|
@ -95,10 +95,13 @@ impl Manifest {
|
||||
fn template(&self) -> String {
|
||||
format!(
|
||||
r#"[package]
|
||||
name = "{}"
|
||||
name = "{name}"
|
||||
version = "0.1.0"
|
||||
description = "The {name} package"
|
||||
remote = "[AUTHOR]/{name}"
|
||||
license = "LICENSE-MIT"
|
||||
"#,
|
||||
self.package.name
|
||||
name = self.package.name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user