428 Commits

Author SHA1 Message Date
Brice Dobry
c825e1e5b6 docs: consistent markdown formatting
The main goal of this commit is to resolve the issues where a newline
was intended, but because Markdown formatting uses two newlines to
separate paragraphs, these lines were being merged. This was especially
apparent in the lists of possible error codes, which I've now
reformatted to use bulleted lists.
2023-03-17 02:28:11 -04:00
Brice Dobry
cc2966bbed docs: fix inconsistent use of none in docs 2023-03-08 12:18:30 -05:00
Brice Dobry
46476ec39b test: fix unit tests 2023-03-06 16:52:39 -05:00
Brice Dobry
1495456ee2 chore: fix string in assertion 2023-03-04 10:24:46 -05:00
Brice Dobry
595aee13fc feat: attach comments to SymbolicExpressions
Comments are only enabled with feature, `developer-mode`. This will be
useful for tools that want to manipulate Clarity source code, like a
formatter for example.
2023-03-02 14:55:20 -05:00
Hugo C
9eabcc5b20 docs: improve principal-construct output type 2023-02-17 15:54:52 +01:00
Hugo Caillard
bc9f3e50e7 docs: fix principal -construct -destruct api reference 2023-02-17 14:43:13 +01:00
Jude Nelson
6b920ba6e4 Merge branch 'develop' into feat/stacks-2.1-changelog 2023-02-16 22:10:44 +00:00
Jude Nelson
2672e0ca2f chore: address 2.1 PR feedback 2023-02-16 16:06:51 -05:00
Hugo Caillard
3b3e9205f3 docs: normalize bitwise operations names 2023-02-14 20:32:16 +01:00
Jude Nelson
32d8a83ae7 Merge branch 'develop' into rft_vec_to_sli 2023-02-02 19:01:17 +00:00
Brice Dobry
0143cde633 fix: add epoch to expected output in tests 2023-02-01 16:55:29 -05:00
Aaron Blankstein
b971cd42ea chore: fix test setup after merge 2023-02-01 13:04:24 -06:00
Jude Nelson
c95e4c2a1a Merge branch 'develop' into feat/abi-add-epoch 2023-02-01 02:21:17 +00:00
Jude Nelson
80e60b6353 Merge branch 'develop' into feat/abi-add-epoch 2023-01-31 21:05:07 +00:00
Jude Nelson
09afa45ff1 Merge branch 'develop' into trait-arg-check 2023-01-31 18:47:13 +00:00
Aaron Blankstein
63eab619e6 refactor: add fallible peek_last_token() 2023-01-31 09:37:45 -06:00
Brice Dobry
70d72a9922 feat: canonicalize all types in ContractAnalysis
For future compatibility, canonicalize all types in the
`ContractAnalysis` structure, not just the outward facing ones.
2023-01-30 21:35:03 -05:00
Aaron Blankstein
2baa69340b chore: fix typo in rustdoc
Co-authored-by: Brice Dobry <brice@hiro.so>
2023-01-30 14:15:48 -06:00
Aaron Blankstein
b7f5f50a2f chore: add more detail to comments 2023-01-30 12:52:12 -06:00
Aaron Blankstein
f16c48286a fix: #3541 by eliminating recursion in parse_list + parse_tuple 2023-01-30 12:37:56 -06:00
Brice Dobry
254990f613 feat: add epoch to abi RPC endpoint
It can be useful for clients to know during which epoch a contract was
published. This was a specific request from the Clarinet team.
2023-01-27 08:44:45 -05:00
Asim Mehmood
9fcf33ce3d refactor: replace vec references with slices 2023-01-27 13:00:37 +05:00
Brice Dobry
b1343ea550 refactor: delete AnalysisDatabase::get_map_type
This method should not be used anywhere (and it is not), so let's delete
it!
2023-01-26 16:50:26 -05:00
Brice Dobry
be86fa7f86 chore: add comments and clean up code 2023-01-25 17:46:06 -05:00
Brice Dobry
4b545b02fb fix: trait passed from Clarity2 into Clarity1 contract
Since Clarity2 can call a Clarity1 contract, the `execute_apply` method
needs to handle the Clarity2 style values, `CallableContract` in
addition to the Clarity1 style, `Principal`.
2023-01-25 10:12:01 -05:00
Brice Dobry
255513141f test: add canonicalization unit tests 2023-01-25 01:15:52 -05:00
Brice Dobry
787f6497b1 fix: fix error in ContractAnalysis canonicalization 2023-01-24 21:29:45 -05:00
Brice Dobry
44fee0b31f fix: canonicalize types from ClarityDatabase 2023-01-24 08:08:55 -05:00
Brice Dobry
3e70b9f974 fix: canonicalize types when reading from analysis DB
See: #3519
2023-01-24 08:08:55 -05:00
Brice Dobry
3d1a834116 fix: canonicalize types when checking contract-call 2023-01-24 08:08:55 -05:00
Jude Nelson
0b2bfc8312 Merge branch 'develop' into feat/2.1.0.0.0-rc2 2023-01-20 20:37:00 +00:00
Brice Dobry
b8e21618f4 fix: fix arg-check for passing 2.05 trait in 2.1 2023-01-19 20:05:29 -05:00
Jude Nelson
cc3eb0f501 Merge branch 'develop' into feat/2.1.0.0.0-rc2 2023-01-18 22:12:22 -05:00
Brice Dobry
51285a1ace chore: clarify the canonicalize method
Rename and add a note so that it is clear that it only handles simple
types, and complex types should be recursed by the caller.
2023-01-18 16:05:11 -05:00
Brice Dobry
9e782945f2 Merge branch 'develop' into fix/trait-types 2023-01-18 15:11:17 -05:00
Brice Dobry
ad56a07889 chore: fix formatting 2023-01-18 11:01:38 -05:00
Brice Dobry
951ed52f56 fix: revert all regex changes in the v1 parser
With the addition of the v2 parser, some of the regex expressions were
moved up to representations.rs so that they could be shared and reused.
This has proven to be a problem, because the strange behavior of the v1
parser was not preserved (e.g. allowing long contract names in
contract-call parameters, but not in contracts).

Fixes: #3470
2023-01-18 09:21:36 -05:00
Brice Dobry
580e811223 chore: fix formatting 2023-01-16 21:43:11 -05:00
Brice Dobry
30670d7097 refactor: canonicalize types in 2.1
Because of traits stored during 2.05 and then used in 2.1, there can be
2.05 types that show up in 2.1. To handle this, this commit adds a
`canonicalize` method, to convert any types from a previous epoch to the
appropriate type for the current epoch. It is re-designed here to be
flexible for future changes in upcoming epochs.
2023-01-16 21:43:11 -05:00
Brice Dobry
bb59448442 fix: handle TraitReferenceType in 2.1
A trait processed during epoch 2.05 which contains a trait type for one
of its parameters will have a `TraitReferenceType` in its function
signature. This behavior changed when we split off the updated
type-checker and continued to run the old one in 2.05, but this one case
was not modified accordingly.

Fixes: #3489
2023-01-16 21:43:11 -05:00
Jude Nelson
e5fdb87035 fix: gate global variable lookup by Clarity version (#3471) 2023-01-08 23:36:32 -05:00
Jude Nelson
b1f7b52f7f fix: fix #3470 by evaluating runtime cost after argument evaluation (as happened before when comparators were native functions) 2023-01-08 23:35:50 -05:00
Brice Dobry
57038c2df1 Merge pull request #3452 from hugocaillard/docs/fix-map-snippet
docs: fix map snippet
2023-01-05 12:54:05 -05:00
Brice Dobry
a81a337680 Merge branch 'next' into docs/fix-index-of-reference 2023-01-05 07:38:26 -05:00
Jude Nelson
b1635b81f8 fix: a contract name can decode with up to 128 characters in the name part 2022-12-28 21:32:30 -05:00
Hugo Caillard
48b687d9bb docs: fix map snippet 2022-12-22 19:11:37 +01:00
Hugo Caillard
af03bfbb31 docs: fix index-of api reference 2022-12-22 19:03:28 +01:00
Brice Dobry
776745636c fix: use Epoch21 in inner_deserialize_read 2022-12-19 20:05:35 -05:00
Brice Dobry
487197789e test: use correct epoch in test 2022-12-19 20:01:33 -05:00