Skip to content

Commit

Permalink
Merge pull request #22 from nearprotocol/j-newprojlog
Browse files Browse the repository at this point in the history
small tweaks to settings.js which is used from main.html
  • Loading branch information
janedegtiareva committed Apr 3, 2019
2 parents de1bfe3 + 8b93e9f commit 6d41313
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions blank_project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "1.0.0",
"scripts": {
"build": "node_modules/near-shell/near build",
"test": "jest test --env=./local_test_environment.js",
"test-on-devnet": "jest test --env=./devnet_test_environment.js"
"test": "jest test --env=./src/local_test_environment.js",
"test-on-devnet": "jest test --env=./src/devnet_test_environment.js"
},
"devDependencies": {
"assemblyscript": "github:nearprotocol/assemblyscript.git",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion blank_project/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h1 id="contract-message"></h1>
</div>
<script src="https://cdn.jsdelivr.net/npm/nearlib@0.4.2/dist/nearlib.js"></script>
<script src="./settings.js"></script>
<script src="./settings_devnet.js"></script>
<script src="./main.js"></script>
</body>
</html>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion blank_project/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function doInitContract() {
window.near = await nearlib.dev.connect(settings);

// Initializing our contract APIs by contract name and configuration.
window.contract = await near.loadContract(contractName, {
window.contract = await near.loadContract(settings.contractName, {
// NOTE: This configuration only needed while NEAR is still in development
// View methods are read only. They don't modify the state, but usually return some value.
viewMethods: ["hello"],
Expand Down
2 changes: 1 addition & 1 deletion blank_project/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ const settings = {
deps: {
createAccount: nearlib.dev.createAccountWithLocalNodeConnection
},
contractName: "hellotest" /* TODO: fill this in! */
};
const contractName = "contract2"; /* TODO: fill this in! */
10 changes: 10 additions & 0 deletions blank_project/src/settings_devnet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const settings = {
nodeUrl: "https://studio.nearprotocol.com/devnet",
baseUrl: "https://studio.nearprotocol.com/contract-api",
contractName: "hellotest",
deps: {
createAccount: (accountId, publicKey) =>
nearlib.dev.createAccountWithContractHelper(
{ baseUrl: "https://studio.nearprotocol.com/contract-api"}, accountId, publicKey)
}
};

0 comments on commit 6d41313

Please sign in to comment.