Skip to content

Commit

Permalink
Merge pull request #38 from BoltzExchange/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Jun 29, 2020
2 parents f879268 + edee587 commit b5a6872
Show file tree
Hide file tree
Showing 14 changed files with 2,251 additions and 1,597 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest]
node-version: [10.x, 12.x]

runs-on: ${{ matrix.platform }}

steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Check out code
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci

- name: Start Bitcoin Core container
run: npm run docker:start

- name: Compile
run: npm run compile

- name: Lint
run: npm run lint

- name: Unit tests
run: npm run test:unit

- name: Integration tests
run: npm run test:int

- name: Contract tests
run: npm run test:solidity
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions contracts/ERC20Swap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pragma solidity 0.6.7;
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity 0.6.10;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand All @@ -18,8 +20,9 @@ contract ERC20Swap {

mapping (bytes32 => Swap) public swaps;

event Claim(bytes32 _preimageHash);
event Creation(bytes32 _preimageHash);

event Claim(bytes32 _preimageHash);
event Refund(bytes32 _preimageHash);

modifier onlyPendingSwaps(bytes32 _preimageHash) {
Expand Down
7 changes: 5 additions & 2 deletions contracts/EtherSwap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pragma solidity 0.6.7;
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity 0.6.10;

contract EtherSwap {
struct Swap {
Expand All @@ -15,8 +17,9 @@ contract EtherSwap {

mapping (bytes32 => Swap) public swaps;

event Claim(bytes32 _preimageHash);
event Creation(bytes32 _preimageHash);

event Claim(bytes32 _preimageHash);
event Refund(bytes32 _preimageHash);

modifier onlyPendingSwaps(bytes32 _preimageHash) {
Expand Down
4 changes: 3 additions & 1 deletion contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pragma solidity 0.6.7;
// SPDX-License-Identifier: MIT

pragma solidity 0.6.10;

contract Migrations {
address public owner;
Expand Down
4 changes: 3 additions & 1 deletion contracts/TestERC20.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pragma solidity 0.6.7;
// SPDX-License-Identifier: MIT

pragma solidity 0.6.10;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 2 additions & 0 deletions docker/bitcoin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ server=1

txindex=1

fallbackfee=0.00001

rpcuser=kek
rpcpassword=kek
rpcallowip=0.0.0.0/0
Expand Down
27 changes: 6 additions & 21 deletions lib/ethereum/ABIs.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
import fs from 'fs';
import path from 'path';
import IERC20 from '../../build/contracts/IERC20.json';
import EtherSwap from '../../build/contracts/EtherSwap.json';
import ERC20Swap from '../../build/contracts/ERC20Swap.json';

const contractsPath = `${path.resolve(__dirname, '..', '..')}/build/contracts`;

const readAbiFile = (contractName: string) => {
return fs.readFileSync(`${contractsPath}/${contractName}.json`);
};

const loadAbi = (contractName: string) => {
return JSON.parse(readAbiFile(contractName).toString())['abi'];
};

const IERC20ABI = loadAbi('IERC20');
const ERC20SwapABI = loadAbi('ERC20Swap');
const EtherSwapABI = loadAbi('EtherSwap');

export {
IERC20ABI,
ERC20SwapABI,
EtherSwapABI,
};
export const IERC20ABI = IERC20.abi;
export const ERC20SwapABI = ERC20Swap.abi;
export const EtherSwapABI = EtherSwap.abi;
Loading

0 comments on commit b5a6872

Please sign in to comment.