Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Commit

Permalink
Minor bug fixes and more manual test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
edison0xyz committed Sep 3, 2018
1 parent d97a578 commit 82ca8de
Show file tree
Hide file tree
Showing 8 changed files with 1,437 additions and 1,380 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Methods that are NOT supported:
* `GetLatestDsBlock`
* `GetLatestTxBlock`

In addition, multi-contract calls are not supported yet.
In addition, the following features are not supported yet:
* Multi-contract calls
* Events

## Installation
Run `npm install`, then `node server.js`.
Expand Down
9 changes: 7 additions & 2 deletions components/scilla/scilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

const fs = require('fs');
const utilities = require('../../utilities');
const config = require('../../config');
const LOG_SCILLA = require('debug')('kaya:scilla');
let blockchain_path = 'tmp/blockchain.json'
let colors = require('colors');
Expand Down Expand Up @@ -66,6 +67,11 @@ const initializeContractState = (amt) => {

const runScillaInterpreterSync = (command) => {
// Run Scilla Interpreter
if(!fs.existsSync(config.scilla.runner_path)) {
LOG_SCILLA('Scilla runner not found. Hint: Have you compiled the scilla binaries?');
throw new Error('Kaya RPC Runtime Error: Scilla-runner not found');
}

const exec = require('child_process').execSync;
const child = exec(command,
(error, stdout) => {
Expand All @@ -90,14 +96,13 @@ module.exports = {

if (isCodeDeployment) {
// initialized with standard message template
cmd = `./components/scilla/scilla-runner -iblockchain ${blockchain_path} -o tmp/${contractAddr}_out.json`;
cmd = `${config.scilla.runner_path} -iblockchain ${blockchain_path} -o tmp/${contractAddr}_out.json`;
isCodeDeployment = true;

init_path = `${dir}${contractAddr}_init.json`;
code_path = `${dir}${contractAddr}_code.scilla`;

LOG_SCILLA('Code Deployment');
console.log(payload);

rawCode = JSON.stringify(payload.code);
cleanedCode = utilities.codeCleanup(rawCode);
Expand Down
4 changes: 4 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ config.wallet = {
defaultNonce: 0
}

config.scilla = {
runner_path: './components/scilla/scilla-runner'
}

config.testconfigs = {
gasPrice: 1,
gasLimit: 10,
Expand Down
Loading

0 comments on commit 82ca8de

Please sign in to comment.