@ckb-ccc/lumos-patches 0.0.16-alpha.2 → 0.0.16-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/default.js +4 -4
- package/dist.commonjs/default.js +6 -7
- package/dist.commonjs/utils.js +1 -2
- package/package.json +4 -4
- package/src/default.ts +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ckb-ccc/lumos-patches
|
|
2
2
|
|
|
3
|
+
## 0.0.16-alpha.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`f21d7e4`](https://github.com/ckb-ecofund/ccc/commit/f21d7e4cf422edab4a836ef6d678b620594fef8d)]:
|
|
8
|
+
- @ckb-ccc/core@0.1.0-alpha.4
|
|
9
|
+
|
|
10
|
+
## 0.0.16-alpha.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`a3d5359`](https://github.com/ckb-ecofund/ccc/commit/a3d53595f6dd11f2f59cdf0086b3d7ce558a2fdd)]:
|
|
15
|
+
- @ckb-ccc/core@0.0.16-alpha.3
|
|
16
|
+
|
|
3
17
|
## 0.0.16-alpha.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/default.js
CHANGED
|
@@ -112,8 +112,8 @@ export function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
|
112
112
|
await Promise.all(cellDeps.map(async (itemLike) => {
|
|
113
113
|
const item = ccc.CellDepInfo.from(itemLike);
|
|
114
114
|
if (item.type && txSkeleton.cellProvider != null) {
|
|
115
|
-
for await (const cell of txSkeleton
|
|
116
|
-
.
|
|
115
|
+
for await (const cell of txSkeleton.cellProvider
|
|
116
|
+
.collector({
|
|
117
117
|
type: item.type,
|
|
118
118
|
})
|
|
119
119
|
.collect()) {
|
|
@@ -162,8 +162,8 @@ export function generateDefaultScriptInfos() {
|
|
|
162
162
|
[ccc.KnownScript.PWLock, 65],
|
|
163
163
|
]
|
|
164
164
|
.map(([script, dummyLockLength]) => [
|
|
165
|
-
generateScriptInfo(testnet[script].codeHash, testnet[script].cellDeps, dummyLockLength),
|
|
166
|
-
generateScriptInfo(mainnet[script].codeHash, mainnet[script].cellDeps, dummyLockLength),
|
|
165
|
+
generateScriptInfo(ccc.hexFrom(testnet[script].codeHash), testnet[script].cellDeps, dummyLockLength),
|
|
166
|
+
generateScriptInfo(ccc.hexFrom(mainnet[script].codeHash), mainnet[script].cellDeps, dummyLockLength),
|
|
167
167
|
])
|
|
168
168
|
.flat();
|
|
169
169
|
}
|
package/dist.commonjs/default.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateScriptInfo = generateScriptInfo;
|
|
4
|
+
exports.generateDefaultScriptInfos = generateDefaultScriptInfos;
|
|
4
5
|
const core_1 = require("@ckb-ccc/core");
|
|
5
6
|
const advanced_1 = require("@ckb-ccc/core/advanced");
|
|
6
7
|
const codec_1 = require("@ckb-lumos/codec");
|
|
@@ -115,8 +116,8 @@ function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
|
115
116
|
await Promise.all(cellDeps.map(async (itemLike) => {
|
|
116
117
|
const item = core_1.ccc.CellDepInfo.from(itemLike);
|
|
117
118
|
if (item.type && txSkeleton.cellProvider != null) {
|
|
118
|
-
for await (const cell of txSkeleton
|
|
119
|
-
.
|
|
119
|
+
for await (const cell of txSkeleton.cellProvider
|
|
120
|
+
.collector({
|
|
120
121
|
type: item.type,
|
|
121
122
|
})
|
|
122
123
|
.collect()) {
|
|
@@ -152,7 +153,6 @@ function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
|
152
153
|
},
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
|
-
exports.generateScriptInfo = generateScriptInfo;
|
|
156
156
|
/**
|
|
157
157
|
* Generates default script information for CCC.
|
|
158
158
|
* @returns An array of lock script information.
|
|
@@ -166,9 +166,8 @@ function generateDefaultScriptInfos() {
|
|
|
166
166
|
[core_1.ccc.KnownScript.PWLock, 65],
|
|
167
167
|
]
|
|
168
168
|
.map(([script, dummyLockLength]) => [
|
|
169
|
-
generateScriptInfo(testnet[script].codeHash, testnet[script].cellDeps, dummyLockLength),
|
|
170
|
-
generateScriptInfo(mainnet[script].codeHash, mainnet[script].cellDeps, dummyLockLength),
|
|
169
|
+
generateScriptInfo(core_1.ccc.hexFrom(testnet[script].codeHash), testnet[script].cellDeps, dummyLockLength),
|
|
170
|
+
generateScriptInfo(core_1.ccc.hexFrom(mainnet[script].codeHash), mainnet[script].cellDeps, dummyLockLength),
|
|
171
171
|
])
|
|
172
172
|
.flat();
|
|
173
173
|
}
|
|
174
|
-
exports.generateDefaultScriptInfos = generateDefaultScriptInfos;
|
package/dist.commonjs/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asserts =
|
|
3
|
+
exports.asserts = asserts;
|
|
4
4
|
/**
|
|
5
5
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
6
6
|
* @public
|
|
@@ -14,4 +14,3 @@ function asserts(condition, message = "Assert failed") {
|
|
|
14
14
|
throw new Error(message);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.asserts = asserts;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/lumos-patches",
|
|
3
|
-
"version": "0.0.16-alpha.
|
|
3
|
+
"version": "0.0.16-alpha.4",
|
|
4
4
|
"description": "Patches for using Lumos with CCC",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@ckb-lumos/config-manager": "^0.24.0-next.1",
|
|
41
41
|
"@ckb-lumos/helpers": "^0.24.0-next.1",
|
|
42
42
|
"@joyid/ckb": "^1.0.1",
|
|
43
|
-
"@ckb-ccc/core": "0.0
|
|
43
|
+
"@ckb-ccc/core": "0.1.0-alpha.4"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
|
|
47
|
-
"lint": "eslint",
|
|
48
|
-
"format": "prettier --write . && eslint --fix"
|
|
47
|
+
"lint": "eslint ./src",
|
|
48
|
+
"format": "prettier --write . && eslint --fix ./src"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/default.ts
CHANGED
|
@@ -171,8 +171,8 @@ export function generateScriptInfo(
|
|
|
171
171
|
cellDeps.map(async (itemLike) => {
|
|
172
172
|
const item = ccc.CellDepInfo.from(itemLike);
|
|
173
173
|
if (item.type && txSkeleton.cellProvider != null) {
|
|
174
|
-
for await (const cell of txSkeleton
|
|
175
|
-
.
|
|
174
|
+
for await (const cell of txSkeleton.cellProvider
|
|
175
|
+
.collector({
|
|
176
176
|
type: item.type,
|
|
177
177
|
})
|
|
178
178
|
.collect()) {
|
|
@@ -243,12 +243,12 @@ export function generateDefaultScriptInfos(): LockScriptInfo[] {
|
|
|
243
243
|
)
|
|
244
244
|
.map(([script, dummyLockLength]) => [
|
|
245
245
|
generateScriptInfo(
|
|
246
|
-
testnet[script]
|
|
247
|
-
testnet[script]
|
|
246
|
+
ccc.hexFrom(testnet[script].codeHash),
|
|
247
|
+
testnet[script].cellDeps,
|
|
248
248
|
dummyLockLength,
|
|
249
249
|
),
|
|
250
250
|
generateScriptInfo(
|
|
251
|
-
mainnet[script]!.codeHash,
|
|
251
|
+
ccc.hexFrom(mainnet[script]!.codeHash),
|
|
252
252
|
mainnet[script]!.cellDeps,
|
|
253
253
|
dummyLockLength,
|
|
254
254
|
),
|