Skip to content

Commit

Permalink
Merge pull request #1422 from iov-one/fixes/reorganize-escrow-contrac…
Browse files Browse the repository at this point in the history
…t-related-code

Reorganizes Escrow contract specific code
  • Loading branch information
Antoine Herzog authored Apr 27, 2020
2 parents fa3ac5f + ac698aa commit ccf3ec6
Show file tree
Hide file tree
Showing 16 changed files with 465 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Erc20TokensMap } from "types";
import { Abi } from "./abi";
import { pubkeyToAddress } from "./address";
import { constants } from "./constants";
import { SwapIdPrefix } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { AtomicSwapContract, SwapContractMethod } from "./smartcontracts/atomicswapcontract";

export class AtomicSwapContractTransactionBuilder {
Expand Down
2 changes: 1 addition & 1 deletion packages/iov-ethereum/src/ethereumcodec.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Encoding } from "@iov/encoding";
import { Erc20ApproveTransaction, Erc20Options } from "./erc20";
import { EthereumCodec } from "./ethereumcodec";
import { EthereumRpcTransactionResult } from "./ethereumrpctransactionresult";
import { SwapIdPrefix } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { testConfig } from "./testconfig.spec";

const { fromHex } = Encoding;
Expand Down
3 changes: 2 additions & 1 deletion packages/iov-ethereum/src/ethereumcodec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import { BlknumForkState, Eip155ChainId, getRecoveryParam } from "./encoding";
import { Erc20ApproveTransaction, Erc20TokensMap } from "./erc20";
import { Erc20TokenTransactionBuilder } from "./erc20tokentransactionbuilder";
import { EthereumRpcTransactionResult } from "./ethereumrpctransactionresult";
import { Serialization, SwapIdPrefix } from "./serialization";
import { Serialization } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { SmartContractConfig } from "./smartcontracts/definitions";
import {
CustomSmartContractTransaction,
Expand Down
2 changes: 1 addition & 1 deletion packages/iov-ethereum/src/ethereumconnection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { pubkeyToAddress } from "./address";
import { Erc20ApproveTransaction } from "./erc20";
import { EthereumCodec } from "./ethereumcodec";
import { EthereumConnection } from "./ethereumconnection";
import { SwapIdPrefix } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { testConfig } from "./testconfig.spec";

const ETH = "ETH" as TokenTicker;
Expand Down
2 changes: 1 addition & 1 deletion packages/iov-ethereum/src/ethereumconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { EthereumCodec } from "./ethereumcodec";
import { EthereumRpcClient } from "./ethereumrpcclient";
import { HttpEthereumRpcClient } from "./httpethereumrpcclient";
import { Parse } from "./parse";
import { SwapIdPrefix } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { AtomicSwapContract, SwapContractEvent } from "./smartcontracts/atomicswapcontract";
import { SmartContractConfig } from "./smartcontracts/definitions";
import {
Expand Down
7 changes: 5 additions & 2 deletions packages/iov-ethereum/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// high level exports
// High level exports
export { Erc20ApproveTransaction, Erc20Options, Erc20TokensMap, isErc20ApproveTransaction } from "./erc20";
export { EthereumConnection, EthereumConnectionOptions } from "./ethereumconnection";
export { createEthereumConnector } from "./ethereumconnector";
export { ethereumCodec, EthereumCodec, EthereumCodecOptions } from "./ethereumcodec";
export { SwapIdPrefix } from "./serialization";
export { SwapIdPrefix } from "./serializationcommon";
// Smart contract exports
export { SmartContractType, SmartContractTokenType, SmartContractConfig } from "./smartcontracts/definitions";
export { getEscrowBySwapId } from "./smartcontracts/escrowcontract";

// Custom helper functions
export { pubkeyToAddress, toChecksummedAddress } from "./address";
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import BN from "bn.js";
import { Erc20ApproveTransaction } from "../erc20";
import { EthereumCodec } from "../ethereumcodec";
import { EthereumConnection } from "../ethereumconnection";
import { SwapIdPrefix } from "../serialization";
import { SwapIdPrefix } from "../serializationcommon";
import { testConfig } from "../testconfig.spec";

const ETH = "ETH" as TokenTicker;
Expand Down
3 changes: 2 additions & 1 deletion packages/iov-ethereum/src/serialization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { ExtendedSecp256k1Signature } from "@iov/crypto";
import { Encoding } from "@iov/encoding";

import { Erc20ApproveTransaction, Erc20Options } from "./erc20";
import { Serialization, SwapIdPrefix } from "./serialization";
import { Serialization } from "./serialization";
import { SwapIdPrefix } from "./serializationcommon";
import { testConfig } from "./testconfig.spec";

const { serializeSignedTransaction, serializeUnsignedTransaction } = Serialization;
Expand Down
Loading

0 comments on commit ccf3ec6

Please sign in to comment.