Riteway test wrapper
- Utility lib for using the riteway testing library with agoric.
- forces you to write tests cases the "rite" way:
- Readable
- Integrated
- Thorough
- Explicit,
const Reducer = run => ({ | |
run, | |
concat: other => Reducer((acc, x) => other.run(run(acc, x), x)), | |
contramap: f => Reducer((acc, x) => run(acc, f(x))), | |
map: f => Reducer((acc, x) => f(run(acc, x))) | |
}); | |
const Id = x => ({ | |
map: f => Id(f(x)), | |
chain: f => f(x), |
import { assert } from './util' | |
const compose = (...fns) => x => fns.reduceRight((y, f) => f(y), x); | |
// const { proxy: accountProxy, revoke: revokeAccount } = Proxy.revocable(objProto, {}); | |
// Reflect.get(accountProxy, 'balance') | |
// objProto.deposit(10000) | |
// Reflect.get(accountProxy,'balance') |
// @ts-check | |
/* global harden */ | |
import '@agoric/zoe/exported.js'; | |
import { AmountMath } from '@agoric/ertp'; | |
import { assert } from '@agoric/assert'; | |
import { Far } from '@endo/marshal'; | |
import { assertIssuerKeywords, swap } from '@agoric/zoe/src/contractSupport'; | |
/** | |
* This is a very simple contract that creates a new issuer and mints payments |
(function(){ | |
const url = top._CVE_URL; | |
alert(`this message originated in a script that was successfully fetched from "${url}" [even though "${top.location.hostname}"'s Content Security Policy may not allow it!] (CVE-2020-6519)`); | |
}()) |
flowchart TD
%%{ init: { 'flowchart': { 'curve': 'monotoneY' } } }%%
subgraph vaultFactory[Vault Factory]
direction BT
vfT1[The vaultFactory owns a number of VaultManagers and a mint for Minted] ---> vfT2
vfT2[vaultFactory is a 'Vault Director Machine' <br/> <br /> - it creates the vaultDirector </br> - vaultDirector is root user] --> vfT3
I hereby claim:
To claim this, I am signing this object:
// Better way | |
const getValue = ({value}) => value; | |
const add = x => y => x + y; | |
const addTen = add(10); | |
const multiply = x => y => x * y; | |
const displayValue = string => value => `${string}::${value}`; | |
const displayLeverageRatio = displayValue('Leverage Ratio'); |
const Either = (() => { | |
const Right = x => ({ | |
chain: f => f(x), | |
ap: other => other.map(x), | |
alt: other => Right(x), | |
extend: f => f(Right(x)), | |
concat: other => | |
other.fold( | |
x => other, | |
y => Right(x.concat(y)), |