Skip to content
Permalink
Browse files

Merge branch 'lerna'

  • Loading branch information...
mariogemoll committed Jun 15, 2019
2 parents 239680e + a2bdbb0 commit c2f7cfcbf7e5997a34c2dd0251c63c8d33c1adfc
Showing with 942 additions and 351 deletions.
  1. +74 −16 .circleci/config.yml
  2. +7 −5 .gitignore
  3. +2 −2 go/chaincode/cash/mint.go
  4. +1 −1 js/demo/bob.js
  5. +1 −1 js/demo/deploy-contract.js
  6. +1 −1 js/demo/deploy-trading-contract.js
  7. +1 −1 js/demo/deposit.js
  8. +1 −1 js/demo/event-handlers/deposit.js
  9. +1 −1 js/demo/event-handlers/transfer.js
  10. +1 −1 js/demo/fabric/init.js
  11. +2 −2 js/demo/fabric/mint.js
  12. +1 −1 js/demo/fabric/print-state.js
  13. +1 −1 js/demo/fabric/transfer-money.js
  14. +2 −2 js/demo/fabric/wallet.js
  15. +1 −1 js/demo/generate-payment-data.js
  16. +1 −1 js/demo/init.js
  17. +1 −1 js/demo/inquire-output-note.js
  18. +1 −1 js/demo/print-state.js
  19. +1 −1 js/demo/transfer-money.js
  20. +2 −2 js/demo/wallet.js
  21. +0 −13 js/deploy.js
  22. +0 −3 js/eth/event-handlers/unpack.js
  23. +6 −0 js/lerna.json
  24. +5 −30 js/package.json
  25. +2 −2 js/{eth → packages/k0-eth}/actions/deposit.js
  26. +1 −1 js/{eth → packages/k0-eth}/actions/merkle-tree-root.js
  27. +3 −3 js/{eth → packages/k0-eth}/actions/transfer.js
  28. +1 −1 js/{eth → packages/k0-eth}/event-handlers/deposit.js
  29. +1 −1 js/{eth → packages/k0-eth}/event-handlers/transfer.js
  30. 0 js/{eth → packages/k0-eth}/flatten-proof.js
  31. 0 js/{ → packages/k0-eth/helpers}/async-fs.js
  32. +3 −3 js/{test → packages/k0-eth}/helpers/compile-contract.js
  33. +5 −5 js/{test → packages/k0-eth}/helpers/compile-contracts.js
  34. 0 js/{ → packages/k0-eth/helpers}/exec-async.js
  35. 0 js/{ → packages/k0-eth/helpers}/read-and-split.js
  36. +1 −1 js/{ → packages/k0-eth/helpers}/vk-from-file.js
  37. 0 js/{ → packages/k0-eth/helpers}/vk-to-sol.js
  38. +3 −3 js/{eth → packages/k0-eth}/index.js
  39. +1 −1 js/{eth → packages/k0-eth}/init-event-handlers.js
  40. +9 −0 js/packages/k0-eth/package.json
  41. +1 −1 js/{eth → packages/k0-eth}/send-transaction.js
  42. +1 −1 js/{eth → packages/k0-eth}/sign-transaction.js
  43. 0 js/{fabric → packages/k0-fabric}/actions/get-state.js
  44. +2 −2 js/{fabric → packages/k0-fabric}/actions/mint.js
  45. 0 js/{fabric → packages/k0-fabric}/actions/transfer.js
  46. 0 js/{fabric → packages/k0-fabric}/client.js
  47. +2 −6 js/{fabric → packages/k0-fabric}/get-config.js
  48. +1 −1 js/{fabric → packages/k0-fabric}/index.js
  49. +1 −1 js/{fabric → packages/k0-fabric}/init-event-handlers.js
  50. +10 −0 js/packages/k0-fabric/package.json
  51. +0 −5 js/{fabric → packages/k0-fabric}/send-transaction.js
  52. 0 js/{fabric → packages/k0-fabric}/wait-for-tx.js
  53. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/cm-at-index.js
  54. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/current-state.js
  55. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/index-of-cm.js
  56. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/index.js
  57. 0 js/{platform-state → packages/k0-in-memory-platform-state}/linked-list.js
  58. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/mt/add.js
  59. 0 js/{platform-state → packages/k0-in-memory-platform-state}/mt/index.js
  60. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/mt/path.js
  61. 0 js/{client → packages/k0-in-memory-platform-state/mt}/request.js
  62. 0 js/{platform-state → packages/k0-in-memory-platform-state}/mt/reset.js
  63. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/mt/root.js
  64. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/mt/simulate-addition.js
  65. +10 −0 js/packages/k0-in-memory-platform-state/package.json
  66. +1 −1 js/{platform-state → packages/k0-in-memory-platform-state}/state-list.js
  67. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/add-note-info.js
  68. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/add-sn-to-note.js
  69. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/conversion.js
  70. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-a-pk.js
  71. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-a-sk.js
  72. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-address.js
  73. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-available-notes.js
  74. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-note-info.js
  75. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-pk-enc.js
  76. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/get-sk-enc.js
  77. +5 −6 js/{secret-store → packages/k0-in-memory-secret-store}/index.js
  78. +9 −0 js/packages/k0-in-memory-secret-store/package.json
  79. 0 js/{secret-store → packages/k0-in-memory-secret-store}/serialize.js
  80. +1 −1 js/{secret-store → packages/k0-in-memory-secret-store}/slurp.js
  81. 0 js/{secret-store → packages/k0-in-memory-secret-store}/spit.js
  82. +111 −91 js/{test/eth → packages/k0-integration-tests-eth}/all.integration.js
  83. +69 −0 js/packages/k0-integration-tests-eth/helpers/async-fs.js
  84. +35 −0 js/packages/k0-integration-tests-eth/helpers/compile-contract.js
  85. +150 −0 js/packages/k0-integration-tests-eth/helpers/compile-contracts.js
  86. +26 −0 js/packages/k0-integration-tests-eth/helpers/deploy.js
  87. +1 −1 js/{test/eth → packages/k0-integration-tests-eth}/helpers/event-handlers/deposit.js
  88. 0 js/{test/eth → packages/k0-integration-tests-eth}/helpers/event-handlers/index.js
  89. +1 −1 js/{test/eth → packages/k0-integration-tests-eth}/helpers/event-handlers/transfer.js
  90. +17 −0 js/packages/k0-integration-tests-eth/helpers/exec-async.js
  91. 0 js/{ → packages/k0-integration-tests-eth/helpers}/proof-from-file.js
  92. +8 −0 js/packages/k0-integration-tests-eth/helpers/read-and-split.js
  93. +1 −1 js/{client → packages/k0-integration-tests-eth/helpers}/ready.js
  94. +11 −0 js/packages/k0-integration-tests-eth/helpers/send-signed-transaction.js
  95. +22 −0 js/packages/k0-integration-tests-eth/helpers/send-transaction.js
  96. +21 −0 js/packages/k0-integration-tests-eth/helpers/sign-transaction.js
  97. +9 −11 js/{test → packages/k0-integration-tests-eth/helpers}/util.js
  98. +31 −0 js/packages/k0-integration-tests-eth/helpers/vk-from-file.js
  99. +24 −0 js/packages/k0-integration-tests-eth/helpers/vk-to-sol.js
  100. 0 js/{test/eth → packages/k0-integration-tests-eth}/network/docker-compose.yml
  101. +24 −0 js/packages/k0-integration-tests-eth/package.json
  102. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/alphaadmin/core.yaml
  103. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/alphaadmin/msp
  104. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/alphapeer/core.yaml
  105. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/alphapeer/msp
  106. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/alphapeer/start.sh
  107. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/bankadmin/core.yaml
  108. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/bankadmin/msp
  109. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/bankpeer/core.yaml
  110. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/bankpeer/msp
  111. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/bankpeer/start.sh
  112. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/betaadmin/core.yaml
  113. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/betaadmin/msp
  114. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/betapeer/core.yaml
  115. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/betapeer/msp
  116. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/betapeer/start.sh
  117. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/cleanup.sh
  118. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/configtx.yaml
  119. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/configureAndStart.sh
  120. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/createChannel.sh
  121. +0 −1 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/crypto-config.yaml
  122. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/docker-compose.yaml
  123. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/gammaadmin/core.yaml
  124. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/gammaadmin/msp
  125. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/gammapeer/core.yaml
  126. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/gammapeer/msp
  127. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/gammapeer/start.sh
  128. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/installChaincodes.sh
  129. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/joinChannels.sh
  130. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/killChainCodes.sh
  131. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/devnetwork/start.sh
  132. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/endorsement-policy.json
  133. +1 −7 js/{test/fabric → packages/k0-integration-tests-fabric}/event-handlers/mint.js
  134. +1 −1 js/{test/fabric → packages/k0-integration-tests-fabric}/event-handlers/transfer.js
  135. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/event-hub.js
  136. +14 −0 js/packages/k0-integration-tests-fabric/helpers/await-event.js
  137. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/client.js
  138. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/get-config.js
  139. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/get-dev-mode-peers.js
  140. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/get-peers.js
  141. +0 −1 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/instantiate-or-upgrade.js
  142. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/read-file.js
  143. +18 −0 js/packages/k0-integration-tests-fabric/helpers/util.js
  144. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/helpers/wait-for-tx.js
  145. +4 −6 js/{test/fabric → packages/k0-integration-tests-fabric}/instantiate.js
  146. BIN js/{test/fabric → packages/k0-integration-tests-fabric}/itermscripts/fabric_0_k0.scpt
  147. BIN js/{test/fabric → packages/k0-integration-tests-fabric}/itermscripts/fabric_1_devmode_setup.scpt
  148. BIN ...ric → packages/k0-integration-tests-fabric}/itermscripts/fabric_2_devmode_chaincode_and_test.scpt
  149. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/itermscripts/install.sh
  150. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/artefacts/.keep
  151. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/configtx.yaml
  152. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/crypto-config.yaml
  153. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/docker-compose-ci.yaml
  154. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/docker-compose.yaml
  155. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/start.sh
  156. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/network/stop.sh
  157. +18 −0 js/packages/k0-integration-tests-fabric/package.json
  158. +26 −30 js/{test/fabric → packages/k0-integration-tests-fabric}/test.js
  159. 0 js/{test/fabric → packages/k0-integration-tests-fabric}/upgrade.js
  160. +17 −0 js/packages/k0-util/exec-async.js
  161. +4 −22 js/{util.js → packages/k0-util/index.js}
  162. +7 −0 js/packages/k0-util/package.json
  163. +1 −1 js/{ → packages/k0-util}/proof-conversion.js
  164. +1 −1 js/{ → packages/k0}/actions/decrypt-note.js
  165. +1 −1 js/{ → packages/k0}/actions/generate-payment-data.js
  166. 0 js/{ → packages/k0}/actions/helpers/encrypt-note.js
  167. +1 −1 js/{ → packages/k0}/actions/prepare-deposit.js
  168. +1 −1 js/{ → packages/k0}/actions/prepare-transfer.js
  169. +1 −1 js/{ → packages/k0}/client/cm.js
  170. +1 −1 js/{ → packages/k0}/client/decrypt-note.js
  171. +5 −3 js/{ → packages/k0}/client/deposit-commitment-proof.js
  172. +1 −1 js/{ → packages/k0}/client/derive-keys.js
  173. +1 −1 js/{ → packages/k0}/client/encrypt-note.js
  174. 0 js/{ → packages/k0}/client/index.js
  175. +5 −3 js/{ → packages/k0}/client/merkle-tree-addition-proof.js
  176. +4 −2 js/{ → packages/k0}/client/prepare-transfer.js
  177. +1 −1 js/{ → packages/k0}/client/prepare_withdrawal.js
  178. +1 −1 js/{ → packages/k0}/client/prf-addr.js
  179. +23 −0 js/packages/k0/client/ready.js
  180. 0 js/{platform-state/mt → packages/k0/client}/request.js
  181. +4 −3 js/{ → packages/k0}/client/verify-proof.js
  182. +2 −1 js/{k0.js → packages/k0/index.js}
  183. +9 −0 js/packages/k0/package.json
  184. +1 −1 js/test/helpers/common-trading-init.js
  185. +1 −1 js/test/private-trade.js
@@ -78,18 +78,63 @@ jobs:
nvm alias default v8
- restore_cache:
keys:
- zktrading-js-deps-$CIRCLE_BRANCH-{{ checksum "js/package.json" }}
- run:
name: Install npm modules
command: cd js && npm i
- zktrading-js-root-deps-$CIRCLE_BRANCH
- zktrading-js-core-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0/package.json" }}
- zktrading-js-eth-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-eth/package.json" }}
- zktrading-js-fabric-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-fabric/package.json" }}
- zktrading-js-platform-state-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-in-memory-platform-state/package.json" }}
- zktrading-js-secret-store-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-in-memory-secret-store/package.json" }}
- zktrading-js-integration-tests-eth-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-integration-tests-eth/package.json" }}
- zktrading-js-integration-tests-fabric-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-integration-tests-fabric/package.json" }}
- run:
name: Install lerna
command: cd js && npm i lerna
- run:
name: Lerna bootstrap
command: cd js && node_modules/.bin/lerna bootstrap --no-ci
- save_cache:
key: zktrading-js-deps-$CIRCLE_BRANCH-{{ checksum "js/package.json" }}
key: zktrading-js-root-deps-$CIRCLE_BRANCH
paths:
- js/node_modules
- save_cache:
key: zktrading-js-core-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0/package.json" }}
paths:
- js/packages/k0/node_modules
- save_cache:
key: zktrading-js-eth-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-eth/package.json" }}
paths:
- js/packages/k0-eth/node_modules
- save_cache:
key: zktrading-js-eth-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-fabric/package.json" }}
paths:
- js/packages/k0-fabric/node_modules
- save_cache:
key: zktrading-js-platform-state-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-in-memory-platform-state/package.json" }}
paths:
- js/packages/k0-in-memory-platform-state/node_modules
- save_cache:
key: zktrading-js-secret-store-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-eth/in-memory-secret-store.json" }}
paths:
- js/packages/k0-in-memory-secret-store/node_modules
- save_cache:
key: zktrading-js-integration-tests-eth-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-integration-tests-eth/package.json" }}
paths:
- js/packages/k0-integration-tests-eth/node_modules
- save_cache:
key: zktrading-js-integration-tests-fabric-deps-$CIRCLE_BRANCH-{{ checksum "js/packages/k0-integration-tests-fabric/package.json" }}
paths:
- js/packages/k0-integration-tests-fabric/node_modules
- persist_to_workspace:
root: .
paths:
- js/node_modules
- js/packages/k0/node_modules
- js/packages/k0-eth/node_modules
- js/packages/k0-fabric/node_modules
- js/packages/k0-in-memory-platform-state/node_modules
- js/packages/k0-in-memory-secret-store/node_modules
- js/packages/k0-integration-tests-eth/node_modules
- js/packages/k0-integration-tests-fabric/node_modules

# This could probably be run more efficiently on the docker executor
chaincode:
@@ -163,6 +208,12 @@ jobs:
done
- attach_workspace:
at: .
- run:
name: Install lerna
command: cd js && npm i lerna
- run:
name: Lerna bootstrap
command: cd js && node_modules/.bin/lerna bootstrap --no-ci
- run:
name: "Generate proving and verification keys"
command: |
@@ -189,7 +240,7 @@ jobs:
- run:
name: "Package K0 chaincode"
command: |
cd js/test/fabric/network
cd js/packages/k0-integration-tests-fabric/network
docker run \
-v $PWD/artefacts:/artefacts \
-v ~/.go_workspace/src/github.com/hyperledger/fabric:/opt/gopath/src/github.com/hyperledger/fabric:ro \
@@ -200,32 +251,30 @@ jobs:
- run:
name: "Spin up Fabric network"
command: |
cd js/test/fabric/network
cd js/packages/k0-integration-tests-fabric/network
CI=true ./start.sh
- run:
name: "Install K0 chaincode"
command: |
cd js/test/fabric/network
cd js/packages/k0-integration-tests-fabric/network
for org in alpha beta gamma bank; do docker-compose run ${org}tools peer chaincode install /artefacts/k0chaincode.1.out; done
- run:
name: "Instantiate K0 chaincode"
command: |
cd js/test/fabric
cd js/packages/k0-integration-tests-fabric
CHAINCODE_ID=k0chaincode node instantiate
- run:
name: "Run integration tests"
command: |
cd js
CHAINCODE_ID=k0chaincode node_modules/.bin/mocha test/fabric/test.js
cd js/packages/k0-integration-tests-fabric
CHAINCODE_ID=k0chaincode node_modules/.bin/mocha test
ethereum_integration_tests:
machine:
image: circleci/classic:201808-01
docker_layer_caching: true
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Docker login
command: docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
@@ -265,11 +314,20 @@ jobs:
chmod +x solc-static-linux && sudo cp solc-static-linux /usr/bin/solc
- run:
name: Run the Docker servers
command: cd js/test/eth/network && docker-compose up -d && docker-compose logs -f
command: cd js/packages/k0-integration-tests-eth/network && docker-compose up -d && docker-compose logs -f
background: true
- attach_workspace:
at: .
- run:
name: init the demo state
command: cd js && npm run test:integration:eth
name: Install lerna
command: cd js && npm i lerna
- run:
name: Lerna bootstrap
command: cd js && node_modules/.bin/lerna bootstrap --no-ci
- run:
name: Run tests
command: cd js/packages/k0-integration-tests-eth && npm test


workflows:
version: 2
@@ -25,10 +25,12 @@
/js/demo/public-keys.json
/js/node_modules
/js/package-lock.json
/js/packages/*/node_modules
/js/packages/*/package-lock.json
/js/public-keys.json
/js/test/fabric/devnetwork/*peer/data
/js/test/fabric/devnetwork/artefacts
/js/test/fabric/devnetwork/crypto-config
/js/test/fabric/network/artefacts
/js/test/fabric/network/crypto-config
/js/packages/k0-integration-tests-fabric/devnetwork/*peer/data
/js/packages/k0-integration-tests-fabric/devnetwork/artefacts
/js/packages/k0-integration-tests-fabric/devnetwork/crypto-config
/js/packages/k0-integration-tests-fabric/network/artefacts
/js/packages/k0-integration-tests-fabric/network/crypto-config
local-notes.txt
@@ -40,7 +40,7 @@ func (t *K0Chaincode) mint(
stub shim.ChaincodeStubInterface,
args [][]byte,
) pb.Response {
fmt.Println("BEGIN MINT ENDORSMENT")
fmt.Println("BEGIN MINT ENDORSEMENT")
expectedArgCount := 7
if len(args) != expectedArgCount {
str := "Incorrect number of arguments. Expecting %d, got: %d"
@@ -164,7 +164,7 @@ func (t *K0Chaincode) mint(

stub.PutState("numLeaves", newNumLeaves[:])

fmt.Println("MINT ENDORSMENT SUCCESS")
fmt.Println("MINT ENDORSEMENT SUCCESS")

return shim.Success(nil)
}
@@ -7,7 +7,7 @@ const addresses = require('./addresses')
const testUtil = require('../test/util')
const makeEthPlatform = require('../eth')
const makeK0 = require('../k0')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const mnemonics = require('./mnemonics')
const signTransaction = require('../eth/sign-transaction')
const compileContracts = require('../test/helpers/compile-contracts')
@@ -1,5 +1,5 @@
const signTransaction = require('../eth/sign-transaction')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')

async function deployContract(web3, artefacts, params, privateKey, gas = 1000000) {
u.checkBuf(privateKey, 32)
@@ -3,7 +3,7 @@
const BN = require('bn.js')
const assert = require('assert')
const inquirer = require('inquirer')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const deployContract = require('./deploy-contract')

async function deployTradingContract(
@@ -10,7 +10,7 @@ const addresses = require('./addresses')
const testUtil = require('../test/util')
const makeEthPlatform = require('../eth')
const makeK0 = require('../k0')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const signTransaction = require('../eth/sign-transaction')
const compileContracts = require('../test/helpers/compile-contracts')
const makePlatformState = require('../platform-state')
@@ -1,5 +1,5 @@
const chalk = require('chalk')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')

async function handleDeposit(platformState, txHash, cm, nextRoot) {
await platformState.add(u.buf2hex(txHash), [], [ cm ], nextRoot)
@@ -2,7 +2,7 @@

const BN = require('bn.js')
const chalk = require('chalk')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')

function decodeData(data) {
u.checkBuf(data, 176)
@@ -6,7 +6,7 @@ const fs = require('fs')
const testUtil = require('../../test/util')
const _ = require('lodash')
const makePlatformState = require('../../platform-state')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')
const makeK0 = require('../../k0')
const log4js = require('log4js')

@@ -7,11 +7,11 @@ const crypto = require('crypto')
const testUtil = require('../../test/util')
const makeFabricPlatform = require('../../fabric')
const makeK0 = require('../../k0')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')
const makePlatformState = require('../../platform-state')
const makeSecretStore = require('../../secret-store')
const log4js = require('log4js')
const demoUtil = require('../util')
const demoUtil = require('@appliedblockchain/k0-util')
const serverPorts = require('./server-ports')
const mtServerPorts = require('./mt-server-ports')
const initEventHandlers = require('./init-event-handlers')
@@ -1,7 +1,7 @@
const chalk = require('chalk')
const log = console.log
const Table = require('cli-table')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')
const inquirer = require('inquirer')

async function printState(secretStore, addressBook, platform, platformState) {
@@ -2,7 +2,7 @@ const crypto = require('crypto')
const inquireInputNote = require('../inquire-input-note')
const inquireOutputNote = require('../inquire-output-note')
const inquirer = require('inquirer')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')

function makeData(a_pk, rho, r, v) {
u.checkBuf(a_pk, 32)
@@ -7,11 +7,11 @@ const crypto = require('crypto')
const testUtil = require('../../test/util')
const makeFabricPlatform = require('../../fabric')
const makeK0 = require('../../k0')
const u = require('../../util')
const u = require('@appliedblockchain/k0-util')
const makePlatformState = require('../../platform-state')
const makeSecretStore = require('../../secret-store')
const log4js = require('log4js')
const demoUtil = require('../util')
const demoUtil = require('@appliedblockchain/k0-util')
const serverPorts = require('./server-ports')
const mtServerPorts = require('./mt-server-ports')
const initEventHandlers = require('./init-event-handlers')
@@ -1,6 +1,6 @@
const BN = require('bn.js')
const inquirer = require('inquirer')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')

async function generatePaymentData(secretStore, k0) {
const inquiryResult = await inquirer.prompt([
@@ -9,7 +9,7 @@ const _ = require('lodash')
const hdkey = require('ethereumjs-wallet/hdkey')
const sendTransaction = require('../send-transaction')
const makePlatformState = require('../platform-state')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const makeK0 = require('../k0')
const log4js = require('log4js')

@@ -3,7 +3,7 @@
const BN = require('bn.js')
const crypto = require('crypto')
const inquirer = require('inquirer')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const assert = require('assert')

async function inquireOutputNote(
@@ -1,7 +1,7 @@
const chalk = require('chalk')
const log = console.log
const Table = require('cli-table')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const inquirer = require('inquirer')

async function printState(secretStore, ethAddressBook, mvpptAddressBook, platform, platformState, carToken, carIds) {
@@ -2,7 +2,7 @@ const crypto = require('crypto')
const inquireInputNote = require('./inquire-input-note')
const inquireOutputNote = require('./inquire-output-note')
const inquirer = require('inquirer')
const u = require('../util')
const u = require('@appliedblockchain/k0-util')
const assert = require('assert')

function makeData(a_pk, rho, r, v) {
@@ -12,8 +12,8 @@ const compileContracts = require('../test/helpers/compile-contracts')
const printState = require('./print-state')
const makePlatformState = require('../platform-state')
const makeSecretStore = require('../secret-store')
const u = require('../util')
const { hex2buf } = require('../util')
const u = require('@appliedblockchain/k0-util')
const { hex2buf } = require('@appliedblockchain/k0-util')
const inquirer = require('inquirer')
const publicKeysInput = require('./public-keys')
const transferMoney = require('./transfer-money')

This file was deleted.

This file was deleted.

@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}

0 comments on commit c2f7cfc

Please sign in to comment.
You can’t perform that action at this time.