-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to SDK and dApp after Depositor contract changes
Depends on: #91 In this PR we adjust SDK and dApp to reflect changes introduced in #91. The contract was renamed from TbtcDepositor to AcreBitcoinDepositor.
- Loading branch information
Showing
12 changed files
with
62 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { TBTCDepositor } from "./tbtc-depositor" | ||
import { BitcoinDepositor } from "./bitcoin-depositor" | ||
|
||
export * from "./tbtc-depositor" | ||
export * from "./bitcoin-depositor" | ||
export * from "./chain-identifier" | ||
export * from "./depositor-proxy" | ||
|
||
/** | ||
* Represents all contracts that allow interaction with the Acre network. | ||
*/ | ||
export type AcreContracts = { | ||
tbtcDepositor: TBTCDepositor | ||
bitcoinDepositor: BitcoinDepositor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { AcreContracts } from "../contracts" | ||
import { EthereumSigner } from "./contract" | ||
import { EthereumTBTCDepositor } from "./tbtc-depositor" | ||
import { EthereumBitcoinDepositor } from "./bitcoin-depositor" | ||
import { EthereumNetwork } from "./network" | ||
|
||
export * from "./eip712-signer" | ||
export * from "./tbtc-depositor" | ||
export * from "./bitcoin-depositor" | ||
export * from "./address" | ||
export { EthereumSigner } | ||
|
||
function getEthereumContracts( | ||
signer: EthereumSigner, | ||
network: EthereumNetwork, | ||
): AcreContracts { | ||
const tbtcDepositor = new EthereumTBTCDepositor({ signer }, network) | ||
const bitcoinDepositor = new EthereumBitcoinDepositor({ signer }, network) | ||
|
||
return { tbtcDepositor } | ||
return { bitcoinDepositor } | ||
} | ||
|
||
export { getEthereumContracts, EthereumNetwork } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { AcreContracts, TBTCDepositor } from "../../src/lib/contracts" | ||
import { AcreContracts, BitcoinDepositor } from "../../src/lib/contracts" | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export class MockAcreContracts implements AcreContracts { | ||
public readonly tbtcDepositor: TBTCDepositor | ||
public readonly bitcoinDepositor: BitcoinDepositor | ||
|
||
constructor() { | ||
this.tbtcDepositor = { | ||
this.bitcoinDepositor = { | ||
getChainIdentifier: jest.fn(), | ||
getTbtcVaultChainIdentifier: jest.fn(), | ||
decodeExtraData: jest.fn(), | ||
encodeExtraData: jest.fn(), | ||
revealDeposit: jest.fn(), | ||
} as TBTCDepositor | ||
} as BitcoinDepositor | ||
} | ||
} |