-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Move Prover][trivial] Eliminate reference in parameters and result t…
…ype for spec functions (#15190) * remove ref for spec fun * add test
- Loading branch information
1 parent
2524895
commit 7eba334
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
third_party/move/move-prover/tests/sources/functional/bug_10784.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module 0x42::m { | ||
|
||
struct RistrettoPoint has drop { | ||
handle: u64 | ||
} | ||
|
||
struct CompressedRistretto has copy, store, drop { | ||
data: vector<u8> | ||
} | ||
|
||
native fun point_compress_internal(point: &RistrettoPoint): vector<u8>; | ||
|
||
spec fun spec_point_compress_internal(point: &RistrettoPoint): vector<u8>; | ||
|
||
spec point_compress_internal(point: &RistrettoPoint): vector<u8> { | ||
pragma opaque; | ||
ensures result == spec_point_compress_internal(point); | ||
} | ||
|
||
public fun point_compress(point: &RistrettoPoint): CompressedRistretto { | ||
CompressedRistretto { | ||
data: point_compress_internal(point) | ||
} | ||
} | ||
|
||
} |