mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 10:41:57 +03:00
Add core mapping functions to AST
This commit is contained in:
parent
34fb0d1815
commit
10875c7edb
@ -36,6 +36,10 @@ pub enum CoreFunction {
|
||||
Poseidon2Hash,
|
||||
Poseidon4Hash,
|
||||
Poseidon8Hash,
|
||||
|
||||
MappingGet,
|
||||
MappingGetOr,
|
||||
MappingPut,
|
||||
}
|
||||
|
||||
impl CoreFunction {
|
||||
@ -59,6 +63,10 @@ impl CoreFunction {
|
||||
(sym::Poseidon2, sym::hash) => Self::Poseidon2Hash,
|
||||
(sym::Poseidon4, sym::hash) => Self::Poseidon4Hash,
|
||||
(sym::Poseidon8, sym::hash) => Self::Poseidon8Hash,
|
||||
|
||||
(sym::Mapping, sym::get) => Self::MappingGet,
|
||||
(sym::Mapping, sym::get_or) => Self::MappingGetOr,
|
||||
(sym::Mapping, sym::put) => Self::MappingPut,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
@ -83,6 +91,10 @@ impl CoreFunction {
|
||||
Self::Poseidon2Hash => 1,
|
||||
Self::Poseidon4Hash => 1,
|
||||
Self::Poseidon8Hash => 1,
|
||||
|
||||
Self::MappingGet => 2,
|
||||
Self::MappingGetOr => 3,
|
||||
Self::MappingPut => 3,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,11 @@ symbols! {
|
||||
BHP768,
|
||||
BHP1024,
|
||||
commit,
|
||||
get,
|
||||
get_or,
|
||||
hash,
|
||||
put,
|
||||
Mapping,
|
||||
Pedersen64,
|
||||
Pedersen128,
|
||||
Poseidon2,
|
||||
|
Loading…
Reference in New Issue
Block a user