forked from NautilusOSS/smart-contract-staking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.sh
96 lines (93 loc) · 1.59 KB
/
commands.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
scs-build-image() {
docker build . -t algokit-builder
}
scs-build-artifacts() {
docker run -v $(pwd):/src -v $(pwd)/artifacts:/artifacts algokit-builder &&
cp -v artifacts/AirdropClient.ts ./src/scripts/clients/ &&
cp -v artifacts/AirdropFactoryClient.ts ./src/scripts/clients/ &&
cp -v artifacts/StakingFactoryClient.ts ./src/scripts/clients/ &&
cp -v artifacts/CompensationFactoryClient.ts ./src/scripts/clients/ &&
cp -v artifacts/MessengerClient.ts ./src/scripts/clients/
}
scs-build-all() {
scs-build-image && scs-build-artifacts
}
scs-simulate() {
(
cd src
python simulate.py
)
}
scs-cli() {
(
cd src/scripts
source demo/utils.sh
npx tsc
cli ${@}
)
}
scs-check-mab() {
(
bash check_mab.sh
)
}
scs-pytest() {
(
cd src
pytest
)
}
scs-demo() {
(
cd src/scripts
case ${1} in
"airdrop") {
bash demo/test-contract-${1}.sh
} ;;
"staking") {
bash demo/test-contract-${1}.sh
} ;;
"compensation") {
bash demo/test-contract-${1}.sh
} ;;
*) {
echo "test not found"
false
} ;;
esac
)
}
scs-mocha() {
(
set -e
cd src/scripts
npx tsc
test ${#} -eq 0 && {
npm test
true
} || {
npm run test-${1}
}
)
}
scs-program() {
(
set -e
cd src/scripts/program
npx tsc
case ${1} in
"airdrop") {
node ${1}.js ${@:2}
} ;;
*) {
cat << EOF
scs-program
execute a program
USAGE scs-program airdrop [command] [args]
EOF
false
} ;;
esac
)
}