From 8d513a5f097faf91597da24d676f32edc31f22e6 Mon Sep 17 00:00:00 2001 From: Li Tian Date: Thu, 10 Sep 2020 14:57:38 +0800 Subject: [PATCH 1/2] update package --- .gitignore | 3 ++- package.json | 2 +- tsconfig.dot.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d28db1d..8596bee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .idea dist release.tgz -.vscode/ \ No newline at end of file +.vscode/ +packed diff --git a/package.json b/package.json index 7b908ca..776bd8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto-coin-kit", - "version": "0.2.27", + "version": "0.2.29", "description": "crypto coin kit for common coins", "main": "./dist/index.js", "scripts": { diff --git a/tsconfig.dot.json b/tsconfig.dot.json index cfa497a..8a050e7 100644 --- a/tsconfig.dot.json +++ b/tsconfig.dot.json @@ -63,6 +63,6 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, - "include": ["src/DOT"], + "include": ["src/DOT", "src/index.ts", "src/third-party-types/**/*"], "exclude": ["node_modules", "**/__tests__/*"] } From 0718d5f16768a833fd56215ddc345867c390b386 Mon Sep 17 00:00:00 2001 From: Li Tian Date: Thu, 10 Sep 2020 15:00:35 +0800 Subject: [PATCH 2/2] enlarge EOS/IOST default expiration time --- src/EOS/index.ts | 2 +- src/IOST/index.ts | 2 +- src/__tests__/coins/IOST.test.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EOS/index.ts b/src/EOS/index.ts index 1f04979..bb4a554 100644 --- a/src/EOS/index.ts +++ b/src/EOS/index.ts @@ -219,7 +219,7 @@ export class EOS implements Coin { }; private getExpiration = (txHeader: Header) => { - const expireInSeconds = txHeader.expireInSeconds || 300; + const expireInSeconds = txHeader.expireInSeconds || 1800; return new Date(txHeader.time + expireInSeconds * 1000) .toISOString() .split('.')[0]; diff --git a/src/IOST/index.ts b/src/IOST/index.ts index aee5ffb..e8d2d75 100644 --- a/src/IOST/index.ts +++ b/src/IOST/index.ts @@ -100,7 +100,7 @@ export class IOST implements Coin { tx.amount_limit = [{token: '*', value: 'unlimited'}]; tx.publisher = from; tx.time = txData.timestamp * 1e6; - tx.expiration = tx.time + (txData.expiration || 300) * 1e9; + tx.expiration = tx.time + (txData.expiration || 1800) * 1e9; tx.delay = 0; const hash = tx._publish_hash(); return {tx, hash}; diff --git a/src/__tests__/coins/IOST.test.ts b/src/__tests__/coins/IOST.test.ts index 2e1bdb3..6c77753 100644 --- a/src/__tests__/coins/IOST.test.ts +++ b/src/__tests__/coins/IOST.test.ts @@ -11,6 +11,7 @@ const txData = { memo: '', amount: '1', timestamp: 1579152770678, + expiration: 300, }; describe('Coin.IOST', () => {