Skip to content

Commit 860cc73

Browse files
Merge pull request #7300 from BitGo/BTC-2652.move-abstract-utxo-impl
feat(abstract-utxo): move and reorganize UTXO coin implementations and tests
2 parents 0239762 + 02e2e69 commit 860cc73

File tree

94 files changed

+294
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+294
-261
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ COPY --from=builder /tmp/bitgo/modules/abstract-utxo /var/modules/abstract-utxo/
5555
COPY --from=builder /tmp/bitgo/modules/blockapis /var/modules/blockapis/
5656
COPY --from=builder /tmp/bitgo/modules/sdk-api /var/modules/sdk-api/
5757
COPY --from=builder /tmp/bitgo/modules/sdk-hmac /var/modules/sdk-hmac/
58+
COPY --from=builder /tmp/bitgo/modules/utxo-ord /var/modules/utxo-ord/
5859
COPY --from=builder /tmp/bitgo/modules/account-lib /var/modules/account-lib/
5960
COPY --from=builder /tmp/bitgo/modules/sdk-coin-ada /var/modules/sdk-coin-ada/
6061
COPY --from=builder /tmp/bitgo/modules/sdk-coin-algo /var/modules/sdk-coin-algo/
@@ -122,7 +123,6 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-bch /var/modules/sdk-coin-bch/
122123
COPY --from=builder /tmp/bitgo/modules/sdk-coin-bcha /var/modules/sdk-coin-bcha/
123124
COPY --from=builder /tmp/bitgo/modules/sdk-coin-bsv /var/modules/sdk-coin-bsv/
124125
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btc /var/modules/sdk-coin-btc/
125-
COPY --from=builder /tmp/bitgo/modules/utxo-ord /var/modules/utxo-ord/
126126
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btg /var/modules/sdk-coin-btg/
127127
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dash /var/modules/sdk-coin-dash/
128128
COPY --from=builder /tmp/bitgo/modules/sdk-coin-doge /var/modules/sdk-coin-doge/
@@ -152,6 +152,7 @@ cd /var/modules/abstract-utxo && yarn link && \
152152
cd /var/modules/blockapis && yarn link && \
153153
cd /var/modules/sdk-api && yarn link && \
154154
cd /var/modules/sdk-hmac && yarn link && \
155+
cd /var/modules/utxo-ord && yarn link && \
155156
cd /var/modules/account-lib && yarn link && \
156157
cd /var/modules/sdk-coin-ada && yarn link && \
157158
cd /var/modules/sdk-coin-algo && yarn link && \
@@ -219,7 +220,6 @@ cd /var/modules/sdk-coin-bch && yarn link && \
219220
cd /var/modules/sdk-coin-bcha && yarn link && \
220221
cd /var/modules/sdk-coin-bsv && yarn link && \
221222
cd /var/modules/sdk-coin-btc && yarn link && \
222-
cd /var/modules/utxo-ord && yarn link && \
223223
cd /var/modules/sdk-coin-btg && yarn link && \
224224
cd /var/modules/sdk-coin-dash && yarn link && \
225225
cd /var/modules/sdk-coin-doge && yarn link && \
@@ -252,6 +252,7 @@ RUN cd /var/bitgo-express && \
252252
yarn link @bitgo/blockapis && \
253253
yarn link @bitgo/sdk-api && \
254254
yarn link @bitgo/sdk-hmac && \
255+
yarn link @bitgo/utxo-ord && \
255256
yarn link @bitgo/account-lib && \
256257
yarn link @bitgo/sdk-coin-ada && \
257258
yarn link @bitgo/sdk-coin-algo && \
@@ -319,7 +320,6 @@ RUN cd /var/bitgo-express && \
319320
yarn link @bitgo/sdk-coin-bcha && \
320321
yarn link @bitgo/sdk-coin-bsv && \
321322
yarn link @bitgo/sdk-coin-btc && \
322-
yarn link @bitgo/utxo-ord && \
323323
yarn link @bitgo/sdk-coin-btg && \
324324
yarn link @bitgo/sdk-coin-dash && \
325325
yarn link @bitgo/sdk-coin-doge && \

modules/abstract-utxo/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"lint": "eslint --quiet .",
1616
"prepare": "npm run build",
1717
"test": "npm run unit-test",
18-
"unit-test": "mocha --recursive test/"
18+
"unit-test": "mocha --recursive test/unit/",
19+
"integration-test": "mocha --recursive test/integration/"
1920
},
2021
"author": "BitGo SDK Team <[email protected]>",
2122
"license": "MIT",
@@ -47,6 +48,7 @@
4748
"@bitgo/sdk-core": "^36.15.0",
4849
"@bitgo/secp256k1": "^1.6.0",
4950
"@bitgo/unspents": "^0.50.5",
51+
"@bitgo/utxo-ord": "^1.22.7",
5052
"@bitgo/utxo-core": "^1.21.1",
5153
"@bitgo/utxo-lib": "^11.13.0",
5254
"@bitgo/wasm-miniscript": "2.0.0-beta.7",
@@ -59,5 +61,9 @@
5961
"lodash": "^4.17.14",
6062
"superagent": "^9.0.1"
6163
},
64+
"devDependencies": {
65+
"@bitgo/sdk-test": "^9.1.7",
66+
"mocha": "^10.2.0"
67+
},
6268
"gitHead": "18e460ddf02de2dbf13c2aa243478188fb539f0c"
6369
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { AbstractUtxoCoin, UtxoNetwork } from '@bitgo/abstract-utxo';
21
import { BitGoBase, BaseCoin } from '@bitgo/sdk-core';
32
import * as utxolib from '@bitgo/utxo-lib';
43

4+
import { AbstractUtxoCoin, UtxoNetwork } from '../../abstractUtxoCoin';
5+
56
export class Bch extends AbstractUtxoCoin {
67
protected constructor(bitgo: BitGoBase, network?: UtxoNetwork) {
78
super(bitgo, network || utxolib.networks.bitcoincash);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './bch';
2+
export * from './tbch';

modules/sdk-coin-bch/src/tbch.ts renamed to modules/abstract-utxo/src/impl/bch/tbch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* @prettier
33
*/
44
import { BaseCoin, BitGoBase } from '@bitgo/sdk-core';
5-
import { Bch } from './bch';
65
import * as bitcoin from '@bitgo/utxo-lib';
76

7+
import { Bch } from './bch';
8+
89
export class Tbch extends Bch {
910
constructor(bitgo: BitGoBase) {
1011
super(bitgo, bitcoin.networks.bitcoincashTestnet);

modules/sdk-coin-bcha/src/bcha.ts renamed to modules/abstract-utxo/src/impl/bcha/bcha.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { BitGoBase, BaseCoin } from '@bitgo/sdk-core';
2-
import { Bch } from '@bitgo/sdk-coin-bch';
32
import * as utxolib from '@bitgo/utxo-lib';
4-
import { UtxoNetwork } from '@bitgo/abstract-utxo';
3+
4+
import { Bch } from '../bch/bch';
5+
import { UtxoNetwork } from '../../abstractUtxoCoin';
56

67
export class Bcha extends Bch {
78
constructor(bitgo: BitGoBase, network?: UtxoNetwork) {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './bcha';
2+
export * from './tbcha';

modules/sdk-coin-bcha/src/tbcha.ts renamed to modules/abstract-utxo/src/impl/bcha/tbcha.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import { BitGoBase, BaseCoin } from '@bitgo/sdk-core';
55
import * as utxolib from '@bitgo/utxo-lib';
6+
67
import { Bcha } from './bcha';
78

89
export class Tbcha extends Bcha {
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { UtxoNetwork } from '@bitgo/abstract-utxo';
2-
import { Bch } from '@bitgo/sdk-coin-bch';
31
import { BitGoBase, BaseCoin } from '@bitgo/sdk-core';
42
import * as utxolib from '@bitgo/utxo-lib';
53

4+
import { UtxoNetwork } from '../../abstractUtxoCoin';
5+
import { Bch } from '../bch/bch';
6+
67
export class Bsv extends Bch {
78
constructor(bitgo: BitGoBase, network?: UtxoNetwork) {
89
super(bitgo, network || utxolib.networks.bitcoinsv);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './bsv';
2+
export * from './tbsv';

0 commit comments

Comments
 (0)