diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-02 04:24:32 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-02 04:24:32 +0800 |
commit | 9f5f31d39fffa873cedc889b5cf963b294a2dcc6 (patch) | |
tree | 073c789cef1143ef6660c882f9db640dd72efb02 /packages/instant/src/util/assert.ts | |
parent | bda9d4c1b099fc4db05d34a1d8dc0543a68413b8 (diff) | |
download | dexon-sol-tools-9f5f31d39fffa873cedc889b5cf963b294a2dcc6.tar.gz dexon-sol-tools-9f5f31d39fffa873cedc889b5cf963b294a2dcc6.tar.zst dexon-sol-tools-9f5f31d39fffa873cedc889b5cf963b294a2dcc6.zip |
feat: add asserts for new API additions
Diffstat (limited to 'packages/instant/src/util/assert.ts')
-rw-r--r-- | packages/instant/src/util/assert.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/instant/src/util/assert.ts b/packages/instant/src/util/assert.ts index 1267a1d23..7c07215bf 100644 --- a/packages/instant/src/util/assert.ts +++ b/packages/instant/src/util/assert.ts @@ -15,6 +15,9 @@ export const assert = { } sharedAssert.doesConformToSchema(variableName, orderSource, schemas.signedOrdersSchema); }, + areValidAssetDatas(variableName: string, assetDatas: string[]): void { + _.forEach(assetDatas, (assetData, index) => assert.isHexString(`${variableName}[${index}]`, assetData)); + }, isValidAssetMetaDataMap(variableName: string, metaDataMap: ObjectMap<AssetMetaData>): void { _.forEach(metaDataMap, (metaData, assetData) => { assert.isHexString(`key ${assetData} of ${variableName}`, assetData); |