Skip to content

Commit

Permalink
Add license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sunify committed Jun 18, 2018
1 parent db6ee4a commit e7a5e8b
Show file tree
Hide file tree
Showing 10 changed files with 432 additions and 11 deletions.
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions index.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const Web3 = require('web3');
const { Tx } = require('parsec-lib');
const lotion = require('lotion');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"author": "Alex Lunyov <isuntc@gmail.com>",
"license": "MIT",
"license": "MPLv2",
"private": true,
"scripts": {
"test": "./node_modules/.bin/jest",
Expand Down
7 changes: 7 additions & 0 deletions src/ContractEventsSubscription.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const EventEmitter = require('events');

module.exports = class ContractEventsSubscription extends EventEmitter {
Expand Down
19 changes: 9 additions & 10 deletions src/client.js
@@ -1,14 +1,20 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const connect = require('lotion-connect');
const Web3 = require('web3');
const { Tx } = require('parsec-lib');
const makeTransfer = require('./makeTransfer');

const web3 = new Web3('https://rinkeby.infura.io');

const privKey =
'0xad8e31c8862f5f86459e7cca97ac9302c5e1817077902540779eef66e21f394a';
const account = web3.eth.accounts.privateKeyToAccount(privKey);
const GCI = '79d6d87c9b21d4aefed9dc2d716fa10d489ea4f298eb96c7cd7302535bf8a9cb';
const GCI = '5758bf796dfb7f447c0d71fa7d75d8a3fd886636cb44d2904a41d0728f5a4af1';

async function run() {
const client = await connect(GCI);
Expand All @@ -17,18 +23,11 @@ async function run() {
console.log(await client.state.balances);
console.log('------');

const deposit = Tx.deposit(12, 5000, account.address);
await client.send({ encoded: deposit.hex() });
console.log('Deposit:', deposit.hex());
console.log('------');
console.log(await client.state.balances);
console.log('------');

const transfer1 = await makeTransfer(
client,
account.address,
'0x8AB21C65041778DFc7eC7995F9cDef3d5221a5ad',
4000,
1000,
{ privKey }
);
await client.send({ encoded: transfer1.hex() });
Expand Down
7 changes: 7 additions & 0 deletions src/eventsRelay.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const connect = require('lotion-connect');
const { Tx, Input, Outpoint } = require('parsec-lib');

Expand Down
7 changes: 7 additions & 0 deletions src/makeTransfer.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const { Tx, Input, Outpoint, Output } = require('parsec-lib');

/*
Expand Down
7 changes: 7 additions & 0 deletions src/utils.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const ethUtil = require('ethereumjs-util');

const map = mapFn => arr => arr.map(mapFn);
Expand Down
7 changes: 7 additions & 0 deletions src/validateBlock.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const { delay } = require('./utils');

module.exports = async (state, chainInfo) => {
Expand Down
7 changes: 7 additions & 0 deletions src/validateTx.js
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/

const { Type, Outpoint } = require('parsec-lib');
const { addrCmp } = require('./utils');

Expand Down

0 comments on commit e7a5e8b

Please sign in to comment.