Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract metadata #697

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
6d62fdd
Skeleton for NEAR bindings generation
vgrichina Dec 6, 2018
e73b1d4
POC for NEAR bindings generation
vgrichina Dec 6, 2018
4501b21
Generating code for BSON encoding/decoding classes
vgrichina Dec 6, 2018
0105039
Test and fix bindings generation for simple class
vgrichina Dec 7, 2018
f64ef1f
Function binding generation
vgrichina Dec 7, 2018
84f6024
Export wrapper function
vgrichina Dec 8, 2018
85de90a
Fix handling of non-nullable types as return result
vgrichina Dec 11, 2018
882c444
Slightly more involved test
vgrichina Dec 11, 2018
b5ea2b0
Change BSON module path
vgrichina Dec 11, 2018
851e238
Started nested object support implementation
vgrichina Dec 11, 2018
eb90648
Declare env.log() function in bindgen example
vgrichina Dec 13, 2018
d90ebca
Re-build dist/
vgrichina Dec 13, 2018
e28e975
Prepend original source to generated bindings on compiler level
vgrichina Dec 13, 2018
1747d02
Return results through return_value(), fix handling void return values
vgrichina Dec 13, 2018
689c53e
Read contract method arguments through input_read_into()
vgrichina Dec 14, 2018
1a3509a
Replace __near_func_ prefix with near_func
vgrichina Dec 14, 2018
ea09608
Fix result serialization
vgrichina Dec 14, 2018
f6d0f84
Fix how method result buffer is returned
vgrichina Dec 17, 2018
948f47f
Merge pull request #1 from nearprotocol/near-bindgen
vgrichina Dec 20, 2018
d6c9eef
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
vgrichina Dec 28, 2018
85de534
Add minimal `near.ts` module
vgrichina Dec 28, 2018
aeaf2e4
Clean-up bindings generation code a little bit
vgrichina Dec 29, 2018
4f125e2
Implement nested objects support
vgrichina Dec 29, 2018
846515e
Add diff to ./test.sh based on snapshots of output
vgrichina Dec 29, 2018
5d7a4e7
Merge pull request #7 from nearprotocol/near-bindgen
vgrichina Jan 3, 2019
f8c012e
Merge pull request #8 from nearprotocol/near-bindgen-test
vgrichina Jan 3, 2019
167e698
Generate encode functions for arrays
vgrichina Jan 3, 2019
803393a
Generate decoding functions for arrays
vgrichina Jan 3, 2019
fa14098
Rebuild dist/
vgrichina Jan 3, 2019
16f3f1c
Fix bug with encoding nested object/arrays
vgrichina Jan 4, 2019
91160b2
Merge pull request #9 from nearprotocol/near-bindgen-arrays
vgrichina Jan 4, 2019
43d83dd
Abort on unexpected BSON properties
vgrichina Jan 4, 2019
455bb7e
Add context to test diff
vgrichina Jan 4, 2019
2ea9bb1
Fix basic type setters error checking
vgrichina Jan 4, 2019
b065403
Merge pull request #11 from nearprotocol/near-bindgen-error-checking
vgrichina Jan 7, 2019
dd1f0df
Implement JSON bindings generation
vgrichina Jan 7, 2019
7733d22
Refactor JSON parser state into separate class
vgrichina Jan 8, 2019
1ea0a2a
Make bindings work for nested objects and arrays
vgrichina Jan 9, 2019
ef00bae
Fix bindings for array of primitives
vgrichina Jan 9, 2019
31c821e
Add prelude with required imports automatically
vgrichina Jan 9, 2019
d83e96b
Include necessary runtime function declarations in generated code
vgrichina Jan 9, 2019
ea8c884
Merge pull request #12 from nearprotocol/json
vgrichina Jan 11, 2019
5320733
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
vgrichina Jan 11, 2019
52751fe
Run test.ts after compilation
vgrichina Jan 15, 2019
3ab7e75
Merge pull request #13 from nearprotocol/test-bindgen
vgrichina Jan 16, 2019
1e4b688
Improve test case with more complicated examples
vgrichina Jan 16, 2019
90cdef6
Add GitLab CI config
vgrichina Jan 16, 2019
01a566f
Run bindgen tests on `nom test`
vgrichina Jan 16, 2019
354285c
Add assemblyscript-json dependency
vgrichina Jan 16, 2019
d726689
Add `prettier` dependency
vgrichina Jan 16, 2019
481907f
Merge pull request #16 from nearprotocol/gitlab-ci
vgrichina Jan 16, 2019
1e94a9e
Merge remote-tracking branch 'upstream/master'
vgrichina Jan 16, 2019
906b8fd
Rebuild dist/
vgrichina Jan 16, 2019
6e8087c
Put generated and wrapped file in separate modules
vgrichina Jan 16, 2019
046a10e
Implement encode/decode sugar
vgrichina Jan 17, 2019
8afb538
Little code cleanup
vgrichina Jan 17, 2019
d8f78a2
Re-compile dist/
vgrichina Jan 18, 2019
8f316b6
Copy imports into bindings from source file
vgrichina Jan 19, 2019
d434750
Re-build dist/ folder
vgrichina Jan 19, 2019
aeabfe0
Change test to demonstrate type conversion bug
vgrichina Jan 20, 2019
1817b03
Minor fixes to test and bindings generation
vgrichina Jan 21, 2019
fbeac02
Workaround for type conversion bug
vgrichina Jan 21, 2019
6ebfaeb
Re-build dist/
vgrichina Jan 21, 2019
1d21c6c
Merge pull request #17 from nearprotocol/bindgen-sugar
vgrichina Jan 26, 2019
f1b96cf
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
vgrichina Feb 16, 2019
5fe80c8
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
vgrichina Feb 21, 2019
ef1c18f
Change simpleName -> name to work with latest AssemblyScript
vgrichina Feb 21, 2019
80b37f6
More fixes to work with latest AssemblyScript
vgrichina Feb 21, 2019
b5e8856
Fix check for already generated bindings needing import
vgrichina Feb 21, 2019
7804103
Run `npm install`
vgrichina Feb 21, 2019
3627532
Rebuild test.wat.expected
vgrichina Feb 21, 2019
ef0d82f
Rebuild dist/
vgrichina Feb 21, 2019
704e67f
Merge pull request #19 from nearprotocol/assemblyscript-update
vgrichina Feb 21, 2019
49fc7a6
Test string array decoder generation
vgrichina Feb 20, 2019
7538db5
Rebuild dist/
vgrichina Feb 22, 2019
c90e09a
Merge pull request #21 from nearprotocol/string-array-input
vgrichina Feb 22, 2019
0cfb0ae
Add tests for double nested object arrays
vgrichina Feb 16, 2019
7e350b5
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
vgrichina Mar 6, 2019
cc0e096
Merge pull request #22 from nearprotocol/fix-nested-array
vgrichina Mar 6, 2019
38b020e
Merge branch 'master' of github.com:nearprotocol/assemblyscript
vgrichina Mar 6, 2019
0cfdd0e
Refactor handler setter generation
vgrichina Feb 28, 2019
c89e0c9
Add u32 type support
vgrichina Feb 28, 2019
376f886
Fix for u32 support so that arrays are also supported
vgrichina Feb 28, 2019
47791c3
Add support for i64 and u64 serialization
vgrichina Mar 1, 2019
f71368a
Add model_near.ts.expected
vgrichina Mar 2, 2019
d1c0608
Fix up tests after merging with latest AssemblyScript
vgrichina Mar 12, 2019
87bb77c
Merge pull request #23 from nearprotocol/number-types
vgrichina Mar 12, 2019
2e860ba
WIP. Removing near_func_ prefix and fixing API
evgenykuzyakov Mar 19, 2019
a4aa1a5
Update expected files and test.js APIs
evgenykuzyakov Mar 20, 2019
6e0dd44
Merge pull request #24 from nearprotocol/wasm-new-read-api
vgrichina Mar 21, 2019
de436a3
Rework encode/decode to support instance decode
evgenykuzyakov Mar 22, 2019
2d82484
Merge pull request #25 from nearprotocol/add-instance-decode
vgrichina Mar 23, 2019
82f1d5a
Instead of returning an object with field `result` return the actual …
evgenykuzyakov Mar 23, 2019
9a12f41
Merge pull request #26 from nearprotocol/remove-result
evgenykuzyakov Mar 26, 2019
2090b4b
Merge remote-tracking branch 'upstream/master'
vgrichina Apr 4, 2019
e5ce113
WIP: Fix bindgen after compiler changes
vgrichina Mar 19, 2019
25d93df
Uint8Array serialization
bowenwang1996 May 8, 2019
8ae0463
use join instead of concat
bowenwang1996 May 9, 2019
146e582
Nit
bowenwang1996 May 9, 2019
97ddc48
Merge pull request #27 from nearprotocol/bytes-serialization
bowenwang1996 May 9, 2019
fcec2e7
Fix binding generation
bowenwang1996 May 23, 2019
a33d08c
Merge branch 'master' into asc-update-wip
bowenwang1996 May 23, 2019
ee05ca5
Fix merge conflict
bowenwang1996 May 23, 2019
d5ef637
Merge remote-tracking branch 'upstream/master' into asc-update-wip
bowenwang1996 May 23, 2019
1becaf9
Merge pull request #28 from nearprotocol/asc-update-wip
bowenwang1996 May 23, 2019
0c5d49d
Nit
bowenwang1996 May 23, 2019
229c217
inject bindings in place
bowenwang1996 Jun 6, 2019
ea20370
fix binding generations
bowenwang1996 Jun 7, 2019
567817e
Merge remote-tracking branch 'origin/master' into assemblyscript-update
bowenwang1996 Jun 7, 2019
7b30ba7
Merge branch 'assemblyscript-update' into fix-bindgen
bowenwang1996 Jun 8, 2019
1d4a428
Merge pull request #31 from nearprotocol/fix-bindgen
bowenwang1996 Jun 8, 2019
f53a63e
Merge remote-tracking branch 'upstream/master' into assemblyscript-up…
bowenwang1996 Jun 11, 2019
5e936dd
Merge remote-tracking branch 'upstream/master' into assemblyscript-up…
bowenwang1996 Jun 12, 2019
d8c4f1d
Update bindings (#35)
bowenwang1996 Jun 13, 2019
30dbe59
u128 support
bowenwang1996 Jun 19, 2019
3a4e8a7
fix an array encoding bug
bowenwang1996 Jun 20, 2019
3eaede5
Merge pull request #37 from nearprotocol/u128
bowenwang1996 Jun 20, 2019
603c1ee
fix tests
bowenwang1996 Jun 21, 2019
00521ad
Merge remote-tracking branch 'upstream/master' into assemblyscript-up…
bowenwang1996 Jun 25, 2019
cdf06e4
basic contract metadata support
bowenwang1996 Jun 27, 2019
8154fa2
add decorator in main.ts
bowenwang1996 Jun 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image: node:latest

stages:
- build
- test

cache:
paths:
- node_modules/

install_dependencies:
stage: build
script:
- rm -rf node_modules
- npm install
artifacts:
paths:
- node_modules/

run_tests:
stage: test
script: npm run make
Empty file modified bin/asinit
100644 → 100755
Empty file.
21 changes: 21 additions & 0 deletions cli/asc.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,27 @@ exports.main = function main(argv, options, callback) {
hasOutput = true;
}

// TODO: Make these generators pluggable?
// Write NEAR bindings
if (args.nearFile != null) {
let nearBindings;
if (args.nearFile.length) {
stats.emitCount++;
stats.emitTime += measure(() => {
nearBindings = assemblyscript.buildNEAR(program);
});
writeFile(args.nearFile, nearBindings, baseDir);
} else if (!hasStdout) {
stats.emitCount++;
stats.emitTime += measure(() => {
nearBindings = assemblyscript.buildNEAR(program);
});
writeStdout(nearBindings);
hasStdout = true;
}
hasOutput = true;
}

// Write text (must be last)
if (args.textFile != null || !hasOutput) {
let wat;
Expand Down
4 changes: 4 additions & 0 deletions cli/asc.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
"type": "s",
"alias": "d"
},
"nearFile": {
"description": "Specifies the NEAR Bindings output file (.near.ts).",
"type": "s"
},
"sourceMap": {
"description": [
"Enables source map generation. Optionally takes the URL",
Expand Down
2 changes: 1 addition & 1 deletion dist/asc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/asc.js.map

Large diffs are not rendered by default.

Loading