Skip to content

Commit

Permalink
Merge branch 'master' into nightshade
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Jun 12, 2019
2 parents 7c1cbdd + 61e8eb6 commit 414ace2
Show file tree
Hide file tree
Showing 8 changed files with 2,514 additions and 31 deletions.
16 changes: 2 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
image: node:10

stages:
- build
- test

cache:
paths:
- node_modules/

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

run_tests:
stage: test
script:
- npm test
- yarn
- yarn test
8 changes: 8 additions & 0 deletions bin/near
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const callViewFunction = {
handler: (argv) => exitOnError(main.callViewFunction(argv))
};

const viewAccount = {
command: 'view_account <accountId>',
desc: 'view given account/contract state',
builder: (yargs) => yargs,
handler: (argv) => exitOnError(main.viewAccount(argv))
};

const sendTokens = {
command: 'send <receiver> <amount>',
desc: 'send tokens to given receiver',
Expand Down Expand Up @@ -158,6 +165,7 @@ yargs // eslint-disable-line
.command(deploy)
.command(scheduleFunctionCall)
.command(callViewFunction)
.command(viewAccount)
.command(sendTokens)
.command(clean)
.command(newProject)
Expand Down
2 changes: 1 addition & 1 deletion blank_project/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@wasm/hello_world_ts",
"name": "hello_world_ts",
"description": "",
"version": "0.0.1",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "near-shell",
"version": "0.6.0",
"version": "0.7.0",
"description": "Command line utilities to interact with near blockchain",
"main": "index.js",
"scripts": {
"build": "echo \"Error: not implemented\" && exit 1",
"deploy": "echo \"Error: not implemented\" && exit 1",
"test": "./test/new_project.sh"
"test": "./test/index.sh"
},
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions test/create_account.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
cd tmp-project
timestamp=$(date +%s)
testaccount=testaccount$timestamp
../bin/near create_account $testaccount

4 changes: 4 additions & 0 deletions test/index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -ex
./test/new_project.sh
./test/create_account.sh
26 changes: 12 additions & 14 deletions test/new_project.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
#!/bin/sh
set -ex

RED='\033[0;31m'
GREEN='\033[0;32m'

# remove temporary blank project
rm -rf test/tmp-project
cd test/
rm -rf tmp-project

# test generating new project in cwd
mkdir tmp-project
cd tmp-project
../../bin/near new_project
npm install
npm uninstall near-shell
npm install ../../
NODE_ENV=development npm run test
../bin/near new_project
yarn
yarn remove near-shell
yarn add ../
NODE_ENV=development yarn test
cd ..
rm -rf tmp-project

# test generating new project in new dir
../bin/near new_project 'tmp-project'
./bin/near new_project 'tmp-project'
cd tmp-project
FILE=package.json
if test -f "$FILE"; then
echo "${GREEN}$FILE exists. Have a cookie!"
echo "$FILE exists. Have a cookie!"
else
echo "${RED}ERROR: file not found."
echo "ERROR: $FILE not found."
exit 1
fi
fi
Loading

0 comments on commit 414ace2

Please sign in to comment.