Skip to content

Instantly share code, notes, and snippets.

View mefrem's full-sized avatar

Max Efremov mefrem

View GitHub Profile
;; bridge-contract
;; Testing Clarity 2 features in Clarinet
;; new built-in keywords that support bridging
;; private functions
(principal-destruct? tx-sender)
enable_next_features = true
epoch_2_0 = 100
epoch_2_05 = 101
epoch_2_1 = 102
pox_2_activation = 103
title
Unit test reference manual

Clarinet supports automatic testing, where your blockchain application requirements can be converted to test cases. Clarinet's testing harness is run on Deno: Define your unit tests and then register them with an API call to Clarinet.test inside your test files.

Clarinet's Deno module comes with a number of predefined objects that simulate the Stacks and Bitcoin production environments your smart contracts operate in. This page is a reference manual for those Deno objects so that you can write robust unit tests for your Clarity smart contracts.

For a complete list of classes, objects, and interfaces available, see the Deno's Clarinet module index.

@mefrem
mefrem / ynab_project
Created September 27, 2019 02:33
Testing Medium codeblock
print(‘2016 7-month period outflows were: ‘,ynab2016.Outflow.sum())
print(‘2019 7-month period outflows were: ‘,ynab2019.Outflow.sum())
2016 7-month period outflows were: 16921.36
2019 7-month period outflows were: 24205.82