mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-13 08:47:17 +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