diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-14 00:57:29 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-14 00:57:29 +0100 |
commit | dca6d303c1d15d49305f538dd62df7a65cdfcc38 (patch) | |
tree | ac820902e91eb32b0b33f9cf5a1850c4079674dc /src/types.ts | |
parent | 48bac7d4a9d2846b0309dab0fb92e1c36f854a92 (diff) | |
download | wallet-core-dca6d303c1d15d49305f538dd62df7a65cdfcc38.tar.xz |
add validators to checkable classes
Diffstat (limited to 'src/types.ts')
-rw-r--r-- | src/types.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/types.ts b/src/types.ts index 39d374069..8f24fda90 100644 --- a/src/types.ts +++ b/src/types.ts @@ -360,8 +360,15 @@ interface Merchant { instance?: string; } -@Checkable.Class +@Checkable.ClassWithValidator export class Contract { + + validate() { + if (this.exchanges.length == 0) { + throw Error("no exchanges in contract"); + } + } + @Checkable.String H_wire: string; |