-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from tonlabs/0.17.0-rc
0.17.0 rc
- Loading branch information
Showing
35 changed files
with
8,565 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,8 @@ | ||
[ignore] | ||
; We fork some components by platform | ||
.*/*[.]android.js | ||
|
||
; Ignore "BUCK" generated dirs | ||
<PROJECT_ROOT>/\.buckd/ | ||
|
||
; Ignore unexpected extra "@providesModule" | ||
.*/node_modules/.*/node_modules/fbjs/.* | ||
|
||
; Ignore duplicate module providers | ||
; For RN Apps installed via npm, "Libraries" folder is inside | ||
; "node_modules/react-native" but in the source repo it is in the root | ||
.*/Libraries/react-native/React.js | ||
|
||
; Ignore polyfills | ||
.*/Libraries/polyfills/.* | ||
|
||
; Ignore metro | ||
.*/node_modules/metro/.* | ||
|
||
; Ignore graphql | ||
.*/node_modules/graphql/.* | ||
.*/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow.* | ||
|
||
; Ignore Electron packager | ||
.*/node_modules/electron-packager/.* | ||
|
||
[untyped] | ||
; Ignore react-native-tab-view | ||
.*/node_modules/react-native-tab-view/.* | ||
|
||
[include] | ||
|
||
[libs] | ||
node_modules/react-native/Libraries/react-native/react-native-interface.js | ||
node_modules/react-native/flow/ | ||
node_modules/react-native/flow-github/ | ||
|
||
[options] | ||
emoji=true | ||
|
||
esproposal.optional_chaining=enable | ||
esproposal.nullish_coalescing=enable | ||
|
||
module.system=haste | ||
module.system.haste.use_name_reducers=true | ||
# get basename | ||
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' | ||
# strip .js or .js.flow suffix | ||
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' | ||
# strip .ios suffix | ||
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' | ||
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' | ||
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' | ||
module.system.haste.paths.blacklist=.*/__tests__/.* | ||
module.system.haste.paths.blacklist=.*/__mocks__/.* | ||
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.* | ||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.* | ||
|
||
munge_underscores=true | ||
|
||
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' | ||
|
||
module.file_ext=.js | ||
module.file_ext=.jsx | ||
module.file_ext=.json | ||
module.file_ext=.native.js | ||
|
||
suppress_type=$FlowIssue | ||
suppress_type=$FlowFixMe | ||
suppress_type=$FlowFixMeProps | ||
suppress_type=$FlowFixMeState | ||
|
||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError | ||
|
||
[version] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
import { convertBigUInt, QLContext, resolveBigUInt } from "../server/arango-types"; | ||
import { Transaction, Account } from "../server/arango-resolvers.v2"; | ||
|
||
test("BigUInt", () => { | ||
expect(convertBigUInt(1, 0x1)).toEqual('11'); | ||
expect(convertBigUInt(1, 0x100)).toEqual('3100'); | ||
expect(convertBigUInt(1, 0x1000000000)).toEqual('a1000000000'); | ||
expect(convertBigUInt(1, 256)).toEqual('3100'); | ||
expect(convertBigUInt(1, '256')).toEqual('3100'); | ||
expect(convertBigUInt(1, '0x256')).toEqual('3256'); | ||
expect(convertBigUInt(1, '0x3100')).toEqual('43100'); | ||
expect(convertBigUInt(1, '3100')).toEqual('3c1c'); | ||
|
||
expect(convertBigUInt(2, 0x1)).toEqual('011'); | ||
expect(convertBigUInt(2, 0x100)).toEqual('03100'); | ||
expect(convertBigUInt(2, 0x1000000000)).toEqual('0a1000000000'); | ||
expect(convertBigUInt(2, 256)).toEqual('03100'); | ||
expect(convertBigUInt(2, '0x3100')).toEqual('043100'); | ||
expect(convertBigUInt(2, '3100')).toEqual('03c1c'); | ||
expect(convertBigUInt(2, '0x10000000000000000')).toEqual('1110000000000000000'); | ||
|
||
expect(resolveBigUInt(1, '11')).toEqual('0x1'); | ||
expect(resolveBigUInt(1, '3100')).toEqual('0x100'); | ||
expect(resolveBigUInt(1, 'a1000000000')).toEqual('0x1000000000'); | ||
expect(resolveBigUInt(1, '43100')).toEqual('0x3100'); | ||
expect(resolveBigUInt(2, '011')).toEqual('0x1'); | ||
|
||
expect(resolveBigUInt(2, '03100')).toEqual('0x100'); | ||
expect(resolveBigUInt(2, '0a1000000000')).toEqual('0x1000000000'); | ||
expect(resolveBigUInt(2, '043100')).toEqual('0x3100'); | ||
expect(resolveBigUInt(2, '1110000000000000000')).toEqual('0x10000000000000000'); | ||
}); | ||
|
||
const resolvers = require('../server/arango-resolvers.v1'); | ||
|
||
test("Filter test", () => { | ||
const filter = { | ||
"id": { "eq": "01d7acd8d454d33c95199346683ef1938d994e6432f1b8a0b11b8eea2556f3b2" }, | ||
"storage": { | ||
"state": { | ||
"AccountActive": { | ||
"code": { "gt": "" }, | ||
"data": { "gt": "" } | ||
} | ||
} | ||
} | ||
}; | ||
const doc = { | ||
"id": "01d7acd8d454d33c95199346683ef1938d994e6432f1b8a0b11b8eea2556f3b2", | ||
"_key": "01d7acd8d454d33c95199346683ef1938d994e6432f1b8a0b11b8eea2556f3b2", | ||
"storage": { | ||
"state": { | ||
"AccountActive": { | ||
"code": "1", | ||
"data": "1", | ||
}, | ||
"AccountUninit": { | ||
"None": null, | ||
"__typename": "None" | ||
}, | ||
"__typename": "AccountStorageStateAccountUninitVariant" | ||
}, "__typename": "AccountStorage" | ||
}, "__typename": "Account" | ||
}; | ||
|
||
console.log('>>>', resolvers.Account.test(doc, filter)); | ||
}); | ||
|
||
test("Generate AQL", () => { | ||
const context = new QLContext(); | ||
let ql = Transaction.ql(context, 'doc', { in_msg: { ne: "1" } }); | ||
expect(ql).toEqual(`doc.in_msg != @v1`); | ||
expect(context.vars.v1).toEqual('1'); | ||
|
||
context.clear(); | ||
ql = Transaction.ql(context, 'doc', { out_msgs: { any: { ne: "1" } } }); | ||
expect(ql).toEqual(`LENGTH(doc.out_msgs[* FILTER CURRENT != @v1]) > 0`); | ||
expect(context.vars.v1).toEqual('1'); | ||
|
||
context.clear(); | ||
ql = Account.ql(context, 'doc', { id: { gt: 'fff' } }); | ||
expect(ql).toEqual(`TO_STRING(doc._key) > @v1`); | ||
expect(context.vars.v1).toEqual('fff'); | ||
|
||
context.clear(); | ||
ql = Account.ql(context, 'doc', { id: { gt: 'fff' }, last_paid: { ge: 20 } }); | ||
expect(ql).toEqual(`(TO_STRING(doc._key) > @v1) AND (doc.last_paid >= @v2)`); | ||
expect(context.vars.v1).toEqual('fff'); | ||
expect(context.vars.v2).toEqual(20); | ||
}); |
Oops, something went wrong.