Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 1cde937

Browse files
bors[bot]tcharding
andauthored
Merge #262
262: Use believable rates r=luckysori a=tcharding Swap semi-believable rates for Ether <-> Bitcoin. 50 Ether is approx 1 bitcoin. In order to do this we need to fund more Ether, fund 1000. Co-authored-by: tcharding <me@tobin.cc>
2 parents 2112543 + f768950 commit 1cde937

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

new_project/examples/btc_eth/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ function createSwap(maker: Actor, taker: Actor): SwapRequest {
104104
},
105105
alpha_asset: {
106106
name: "bitcoin",
107-
quantity: toSatoshi(1).toString(),
107+
quantity: toSatoshi(0.1).toString(),
108108
},
109109
beta_asset: {
110110
name: "ether",
111-
quantity: "1000000000000000000",
111+
quantity: "5000000000000000000",
112112
},
113113
beta_ledger_redeem_identity: redeemAddress,
114114
alpha_expiry: moment().unix() + 7200,

new_project/examples/separate_apps/src/maker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { createActor, sleep } from "./lib";
6868
tradingPair: "ETH-BTC",
6969
validUntil: moment().unix() + 300,
7070
ask: {
71-
nominalAmount: "9",
71+
nominalAmount: "50",
7272
asset: "ether",
7373
ledger: "ethereum",
7474
},

new_project/examples/separate_apps/src/taker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { createActor, sleep } from "./lib";
4444
const isOrderAcceptable = (order: Order) => {
4545
// Check if the returned order matches the requested asset-pair
4646
if (order.ask.asset !== "ether" || order.bid.asset !== "bitcoin") {
47-
// These are'nt the droids you're looking for
47+
// These aren't the droids you're looking for
4848
return false;
4949
}
5050

@@ -56,7 +56,7 @@ import { createActor, sleep } from "./lib";
5656
return false;
5757
}
5858
// Only accept orders that are at least 1 bitcoin for 10 Ether
59-
const minRate = 0.1;
59+
const minRate = 0.001;
6060
const orderRate = bitcoin / ether;
6161
console.log("Rate offered: ", orderRate);
6262
return orderRate > minRate;

src/docker/ethereum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async fn fund_new_account(endpoint: ParityHttpEndpoint) -> anyhow::Result<Accoun
9090
client.clone(),
9191
Some(derive_address(account.private_key)),
9292
30_000,
93-
U256::from(100u128 * 10u128.pow(18)),
93+
U256::from(1000u128 * 10u128.pow(18)),
9494
Vec::new(),
9595
)
9696
.await?;

0 commit comments

Comments
 (0)