Skip to content

Commit

Permalink
[fix] add expire to pending banner;
Browse files Browse the repository at this point in the history
update pw-core to latest version
  • Loading branch information
zhixian committed Mar 8, 2021
1 parent 9e2261f commit b765abd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# PORT=8080

BASE_URL=https://cellapitest.ckb.pw
CKB_NODE=https://lay2.ckb.dev
CKB_NODE=https://testnet.ckb.dev

EXPLORER_URL=https://explorer.ckb.pw/devnet
EXPLORER_URL=https://explorer.nervos.org/aggron
DAO_LOCK_PERIOD_EPOCHS=180

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"@lay2/pw-core": "^0.3.8",
"@lay2/pw-core": "^0.3.22",
"@quasar/extras": "^1.0.0",
"axios": "^0.18.1",
"jsbi": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion prod.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# PORT=8080

BASE_URL=https://cellapiprod.ckb.pw
CKB_NODE=https://lina.ckb.dev
CKB_NODE=https://mainnet.ckb.dev

EXPLORER_URL=https://explorer.nervos.org
DAO_LOCK_PERIOD_EPOCHS=180
8 changes: 7 additions & 1 deletion src/models/dao-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ export class DaoCell extends Cell {
daysLeft,
epochsPast
) {
super(capacity, lock, PWCore.config.daoType.script, outPoint, data);
super(
capacity,
lock,
PWCore.config.daoType.script,
outPoint,
data || "0x0000000000000000"
);
this.currentCapacity = currentCapacity;
this.revenue = currentCapacity.sub(capacity);
this.apc = apc;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
this.items.find((i) =>
this.banner.link.endsWith(i.outPoint.txHash)
) !== undefined
|| this.banner.expired <= new Date().getTime()
) {
this.banner = {};
this.$q.localStorage.remove("banner");
Expand Down Expand Up @@ -266,6 +267,7 @@
this.banner = {
show: true,
type: "positive",
expired: new Date().getTime() + 5 * 60 * 1000,
loading: true,
message: this.$t("banner.pending"),
link: `${process.env.EXPLORER_URL}/transaction/${txHash}`,
Expand Down
5 changes: 2 additions & 3 deletions src/services/deposit-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ export default class DepositBuilder extends Builder {
let neededAmount = this.capacity;
if (fee) neededAmount = neededAmount.add(fee);

const inputCells = await PWCore.defaultCollector.collect(
address,
const inputCells = await PWCore.defaultCollector.collect(address, {
neededAmount
);
});
const inputAmount = inputCells
.map(c => c.capacity)
.reduce((sum, a) => sum.add(a));
Expand Down
4 changes: 3 additions & 1 deletion src/services/withdraw1-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export default class Withdraw1Builder extends Builder {

const inputCells = await PWCore.defaultCollector.collect(
this.cell.lock.toAddress(),
neededAmount
{
neededAmount
}
);

const inputAmount = inputCells
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1064,17 +1064,18 @@
dependencies:
"@hapi/hoek" "^8.3.0"

"@lay2/pw-core@^0.3.8":
version "0.3.8"
resolved "https://registry.yarnpkg.com/@lay2/pw-core/-/pw-core-0.3.8.tgz#215572042ea54f8843e5ac0728543aecf778c0b3"
integrity sha512-1Fl2e3HLi5tUqiqfxr657w6h6bg+KVRZBoG1rSJFAuUauJ/h3mI4Hj2Kc7HO6NZTPlq9KqCm/EY0WT0wrEUqAg==
"@lay2/pw-core@^0.3.22":
version "0.3.22"
resolved "https://registry.yarnpkg.com/@lay2/pw-core/-/pw-core-0.3.22.tgz#c52ecd762317703f150825f12d48cb51d78bca11"
integrity sha512-Wo4vhWynLqSR4EcES+64Xbnoo4XGY7dAd5RmIBZEEgxKCL7afMrkH0km4qC5J9aDqKKD0WDrUHekomzIMVuEMA==
dependencies:
"@ckb-lumos/types" "^0.2.4"
"@nervosnetwork/ckb-sdk-utils" "^0.32.0"
axios "^0.19.2"
bech32 "^1.1.4"
blake2b "^2.1.3"
ckb-js-toolkit "^0.9.1"
decimal.js "^10.2.1"
ethereum-ens "^0.8.0"
ethereumjs-util "^7.0.2"
jsbi "^3.1.2"
Expand Down Expand Up @@ -3520,6 +3521,11 @@ decamelize@^1.1.2, decamelize@^1.2.0:
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=

decimal.js@^10.2.1:
version "10.2.1"
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3"
integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==

decode-uri-component@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
Expand Down

1 comment on commit b765abd

@vercel
Copy link

@vercel vercel bot commented on b765abd Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.