Skip to content

Commit

Permalink
refactor: normalize manifest files and use the manifest description p…
Browse files Browse the repository at this point in the history
…roperty for metadata parsing
  • Loading branch information
hugocaillard committed Mar 7, 2023
1 parent a6ec5dc commit 0b89897
Show file tree
Hide file tree
Showing 37 changed files with 224 additions and 364 deletions.
Binary file removed .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.cache
.cache
.DS_Store
5 changes: 2 additions & 3 deletions examples/blank-project/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

{
"deno.enable": true,
"files.eol": "\n"
"deno.enable": true,
"files.eol": "\n"
}
31 changes: 15 additions & 16 deletions examples/blank-project/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

{
"version": "2.0.0",
"tasks": [
{
"label": "check contracts",
"group": "test",
"type": "shell",
"command": "clarinet check"
},
{
"label": "test contracts",
"group": "test",
"type": "shell",
"command": "clarinet test"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "check contracts",
"group": "test",
"type": "shell",
"command": "clarinet check"
},
{
"label": "test contracts",
"group": "test",
"type": "shell",
"command": "clarinet test"
}
]
}
16 changes: 6 additions & 10 deletions examples/blank-project/Clarinet.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

[project]
name = "blank-project"
description = ""
description = "A blank project to start from scratch."
authors = []
telemetry = true
cache_dir = "./.cache"
Expand All @@ -11,12 +10,9 @@ cache_dir = "./.cache"

[repl.analysis]
passes = ["check_checker"]
check_checker = { trusted_sender = false, trusted_caller = false, callee_filter = false }

# Check-checker settings:
# trusted_sender: if true, inputs are trusted after tx_sender has been checked.
# trusted_caller: if true, inputs are trusted after contract-caller has been checked.
# callee_filter: if true, untrusted data may be passed into a private function without a
# warning, if it gets checked inside. This check will also propagate up to the
# caller.
# More informations: https://www.hiro.so/blog/new-safety-checks-in-clarinet
[repl.analysis.check_checker]
strict = false
trusted_sender = false
trusted_caller = false
callee_filter = false
Empty file.
1 change: 0 additions & 1 deletion examples/blank-project/description.txt

This file was deleted.

Empty file.
29 changes: 0 additions & 29 deletions examples/city-coin/Clarinet.toml

This file was deleted.

178 changes: 0 additions & 178 deletions examples/city-coin/contracts/newyorkcitycoin-token-v2.clar

This file was deleted.

1 change: 0 additions & 1 deletion examples/city-coin/description.txt

This file was deleted.

28 changes: 0 additions & 28 deletions examples/city-coin/tests/newyorkcitycoin-token-v2_test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

**/settings/Mainnet.toml
**/settings/Testnet.toml
.cache/**
Expand Down
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions examples/citycoin/Clarinet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[project]
name = "citycoin"
description = "A real-world use case demonstrates the proof of transfer of New York City Coins from one account to another."
authors = []
telemetry = true
cache_dir = "./.cache"

[[project.requirements]]
contract_id = "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27.citycoin-token-trait"
[[project.requirements]]
contract_id = "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27.citycoin-core-trait"
[[project.requirements]]
contract_id = "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard"
[[project.requirements]]
contract_id = "SP2H8PY27SEZ03MWRKS5XABZYQN17ETGQS3527SA5.newyorkcitycoin-auth"

[contracts.newyorkcitycoin-token-v2]
path = "contracts/newyorkcitycoin-token-v2.clar"
clarity_version = 1

[repl.analysis]
passes = ["check_checker"]

[repl.analysis.check_checker]
strict = false
trusted_sender = false
trusted_caller = false
callee_filter = false
File renamed without changes.
33 changes: 33 additions & 0 deletions examples/citycoin/tests/newyorkcitycoin-token-v2_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
Clarinet,
Tx,
Chain,
Account,
types,
} from "https://deno.land/x/[email protected]/index.ts";
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";

// TODO

Clarinet.test({
name: "Ensure that <...>",
async fn(chain: Chain, accounts: Map<string, Account>) {
let block = chain.mineBlock([
/*
* Add transactions with:
* Tx.contractCall(...)
*/
]);
assertEquals(block.receipts.length, 0);
assertEquals(block.height, 2);

block = chain.mineBlock([
/*
* Add transactions with:
* Tx.contractCall(...)
*/
]);
assertEquals(block.receipts.length, 0);
assertEquals(block.height, 3);
},
});
Loading

0 comments on commit 0b89897

Please sign in to comment.