Skip to content

Commit

Permalink
Merge pull request #50 from sun-rhythms/fix-tests-and-tutorials-links
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftAdviser authored Oct 17, 2023
2 parents d262be1 + 2fb7d32 commit 6ce47ba
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 32 deletions.
15 changes: 10 additions & 5 deletions 01-wallet/test/npmton/step7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ import { mnemonicToWalletKey } from "@ton/crypto";
import { WalletContractV4 } from "@ton/ton";

async function main() {
// GH Actions tests use GH secret as mnemonic
// to run this test locally, you should create the file .env in the project root
// with your mnemonic phrase (according to repo README)
// and change step7.expected wallet address to yours
const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC ;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';


// open wallet v4 (notice the correct wallet version here)
const key = await mnemonicToWalletKey(mnemonic!.split(" "));
Expand Down
10 changes: 9 additions & 1 deletion 01-wallet/test/npmton/step8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { mnemonicToWalletKey } from "@ton/crypto";
import { WalletContractV4, TonClient, fromNano } from "@ton/ton";

async function main() {
const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';

const key = await mnemonicToWalletKey(mnemonic!.split(" "));
const wallet = WalletContractV4.create({ publicKey: key.publicKey, workchain: 0 });
Expand Down
12 changes: 10 additions & 2 deletions 01-wallet/test/npmton/step9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ import { mnemonicToWalletKey } from "@ton/crypto";
import { TonClient, WalletContractV4, internal } from "@ton/ton";

async function main() {

const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';

const key = await mnemonicToWalletKey(mnemonic!.split(" "));
const wallet = WalletContractV4.create({ publicKey: key.publicKey, workchain: 0 });

Expand Down
15 changes: 10 additions & 5 deletions 01-wallet/test/tonweb/step7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ import { mnemonicToKeyPair } from "tonweb-mnemonic";
import TonWeb from "tonweb";

async function main() {
// GH Actions tests use GH secret as mnemonic
// to run this test locally, you should create the file .env in the project root
// with your mnemonic phrase (according to repo README)
// and change step7.expected wallet address to yours
const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';

const key = await mnemonicToKeyPair(mnemonic!.split(" "));

// open wallet v4 (notice the correct wallet version here)
Expand Down
11 changes: 10 additions & 1 deletion 01-wallet/test/tonweb/step8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ import { mnemonicToKeyPair } from "tonweb-mnemonic";
import TonWeb from "tonweb";

async function main() {
const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';

const key = await mnemonicToKeyPair(mnemonic!.split(" "));

// initialize ton rpc client on testnet
Expand Down
11 changes: 10 additions & 1 deletion 01-wallet/test/tonweb/step9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ import { mnemonicToKeyPair } from "tonweb-mnemonic";
import TonWeb from "tonweb";

async function main() {
const mnemonic = process.env.MNEMONIC;
// Notice:
// Due to limitations in GitHub Actions, we are unable to use secrets to
// store a secure mnemonic for the wallet during the testing of pull
// requests from forked repositories by our contributors.
// As a result, we are currently using a public wallet with an exposed mnemonic in
// our test files when running tests in GH Actions.
// const mnemonic = process.env.MNEMONIC;
const mnemonic =
'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical';

const key = await mnemonicToKeyPair(mnemonic!.split(" "));

// initialize ton rpc client on testnet
Expand Down
2 changes: 1 addition & 1 deletion 02-contract/test/counter.fc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdlib.fc";
#include "imports/stdlib.fc";

;; =============== storage =============================

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion 02-contract/test/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ npm install ts-node
npm install @ton-community/func-js
npm install @ton/ton @ton/core @ton/crypto
npm install @orbs-network/ton-access
npx func-js stdlib.fc counter.fc --boc counter.cell
npx func-js ./imports/stdlib.fc counter.fc --boc counter.cell
npx ts-node deploy.step8.ts > deploy.step8.output.txt
COUNTER_ADDRESS=`cut -d : -s -f 2 < deploy.step8.output.txt` npx ts-node getCounter.ts > getCounter.output.txt
diff getCounter.output.txt getCounter.expected.txt
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@
> The official mnemonic appears in Github repo secrets since it's also used in CI. This should be the 24 word mnemonic for a deployed testnet v4 wallet that contains at least 1 TON.
- Run `./build.sh`
- Resulting files will be created in the `docs/` directory, ready for Github Pages

### Notice

> Due to limitations in GitHub Actions, we are unable to use secrets to store a secure mnemonic for the wallet during the testing of pull requests from forked repositories by our contributors.
> As a result, we are currently using a public wallet with an exposed mnemonic in our test files when running tests in GH Actions.
4 changes: 2 additions & 2 deletions docs/assets/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const getTutorialLinks = () => document.querySelectorAll("[data=tutorial-link]")

const setSelectedTutorialLink = () => {
getTutorialLinks().forEach((tutorialLink) => {
if(tutorialLink.href === window.location.href) {
tutorialLink.classList.add("selected");
if (`${tutorialLink.href}/` === window.location.href) {
tutorialLink.classList.add('selected');
}
});
};
Expand Down
9 changes: 4 additions & 5 deletions docs/assets/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/styles.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/assets/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const getTutorialLinks = () => document.querySelectorAll("[data=tutorial-link]")

const setSelectedTutorialLink = () => {
getTutorialLinks().forEach((tutorialLink) => {
if(tutorialLink.href === window.location.href) {
tutorialLink.classList.add("selected");
if (`${tutorialLink.href}/` === window.location.href) {
tutorialLink.classList.add('selected');
}
});
};
Expand Down
9 changes: 4 additions & 5 deletions styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ a {
border-bottom: .75px solid #08c9;
}

a.selected {
text-decoration: underline;
pointer-events: none;
}

/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
Expand Down Expand Up @@ -617,6 +612,10 @@ a.alogo:hover, a.alogo:visited, a.alogo:link, a.alogo:active {
font-size: 14px;
text-decoration: unset;
}
a.selected {
text-decoration: underline;
pointer-events: none;
}
}
}

Expand Down

0 comments on commit 6ce47ba

Please sign in to comment.