Skip to content

Commit

Permalink
Merge pull request #281 from interlay/dan/bot-utils
Browse files Browse the repository at this point in the history
refactor: Expose utilities for bot
  • Loading branch information
nud3l authored Apr 29, 2021
2 parents e556a1c + cd397f9 commit 0c41663
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@interlay/polkabtc",
"version": "0.14.1",
"version": "0.14.2",
"description": "JavaScript library to interact with PolkaBTC",
"main": "build/index.js",
"typings": "build/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@interlay/esplora-btc-api": "0.4.0",
"@interlay/polkabtc-types": "0.6.2",
"@types/big.js": "^4.0.5",
"@types/big.js": "4.0.5",
"big.js": "6.0.3",
"bitcoinjs-lib": "^5.2.0",
"cross-fetch": "^3.0.6",
Expand Down
2 changes: 1 addition & 1 deletion src/external/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { ElectrsAPI } from "./electrs";
export { ElectrsAPI, DefaultElectrsAPI } from "./electrs";
26 changes: 13 additions & 13 deletions src/parachain/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export { VaultsAPI } from "./vaults";
export { IssueAPI, IssueRequestExt } from "./issue";
export { RedeemAPI, RedeemRequestExt } from "./redeem";
export { RefundAPI, RefundRequestExt } from "./refund";
export { StakedRelayerAPI } from "./staked-relayer";
export { OracleAPI } from "./oracle";
export { BTCRelayAPI } from "./btc-relay";
export { CollateralAPI } from "./collateral";
export { TreasuryAPI } from "./treasury";
export { SystemAPI } from "./system";
export { ConstantsAPI } from "./constants";
export { ReplaceAPI, ReplaceRequestExt } from "./replace";
export { FeeAPI } from "./fee";
export { VaultsAPI, DefaultVaultsAPI } from "./vaults";
export { IssueAPI, DefaultIssueAPI, IssueRequestExt } from "./issue";
export { RedeemAPI, DefaultRedeemAPI, RedeemRequestExt } from "./redeem";
export { RefundAPI, DefaultRefundAPI, RefundRequestExt } from "./refund";
export { StakedRelayerAPI, DefaultStakedRelayerAPI } from "./staked-relayer";
export { OracleAPI, DefaultOracleAPI } from "./oracle";
export { BTCRelayAPI, DefaultBTCRelayAPI } from "./btc-relay";
export { CollateralAPI, DefaultCollateralAPI } from "./collateral";
export { TreasuryAPI, DefaultTreasuryAPI } from "./treasury";
export { SystemAPI , DefaultSystemAPI} from "./system";
export { ConstantsAPI, DefaultConstantsAPI } from "./constants";
export { ReplaceAPI, DefaultReplaceAPI, ReplaceRequestExt } from "./replace";
export { FeeAPI, DefaultFeeAPI } from "./fee";
export * from "./transaction";
6 changes: 5 additions & 1 deletion src/utils/bitcoin-core-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ export class BitcoinCoreClient {
};
}

async mineBlocks(n: number): Promise<void> {
async mineBlocksWithoutDelay(n: number): Promise<void> {
const newWalletAddress = await this.client.command("getnewaddress");
await this.client.command("generatetoaddress", n, newWalletAddress);
}

async mineBlocks(n: number): Promise<void> {
await this.mineBlocksWithoutDelay(n);
// A block is relayed every 6000ms by the staked-relayer.
// Wait an additional 100ms to be sure
const relayPeriodWithBuffer = 6100;
Expand Down

0 comments on commit 0c41663

Please sign in to comment.