From 71047bfc2238326510aae187d8865907ea91de1c Mon Sep 17 00:00:00 2001 From: ara-klaytn Date: Thu, 11 Jan 2024 15:08:06 +0800 Subject: [PATCH 1/2] Date bug --- .vscode/settings.json | 5 +++++ aptos-tx-latency-measurement/sendtx_aptos.js | 1 + arbitrium-tx-latency-measurement/sendtx_arbitrium.js | 1 + klaytn-tx-latency-measurement/sendtx_klaytn.js | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c06d8e3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "[css][html][javascript][javascriptreact][json][jsonc][typescript][typescriptreact][svelte]": { + "editor.codeActionsOnSave": [] + } +} diff --git a/aptos-tx-latency-measurement/sendtx_aptos.js b/aptos-tx-latency-measurement/sendtx_aptos.js index 0e140ac..4cbda30 100644 --- a/aptos-tx-latency-measurement/sendtx_aptos.js +++ b/aptos-tx-latency-measurement/sendtx_aptos.js @@ -237,6 +237,7 @@ async function sendTx() { try { await uploadChoice(data); } catch (err) { + const now = new Date(); sendSlackMsg(`${now}, failed to upload aptos, ${err.toString()}`); console.log( `failed to ${process.env.UPLOAD_METHOD === "AWS" ? "s3" : "gcs"}.upload!! Printing instead!`, diff --git a/arbitrium-tx-latency-measurement/sendtx_arbitrium.js b/arbitrium-tx-latency-measurement/sendtx_arbitrium.js index 16b2e54..d845a9e 100644 --- a/arbitrium-tx-latency-measurement/sendtx_arbitrium.js +++ b/arbitrium-tx-latency-measurement/sendtx_arbitrium.js @@ -270,6 +270,7 @@ async function sendTx() { try { await uploadChoice(data); } catch (err) { + const now = new Date(); sendSlackMsg(`${now}, failed to upload arbitrium, ${err.toString()}`); console.log( diff --git a/klaytn-tx-latency-measurement/sendtx_klaytn.js b/klaytn-tx-latency-measurement/sendtx_klaytn.js index 0800010..e7b697c 100644 --- a/klaytn-tx-latency-measurement/sendtx_klaytn.js +++ b/klaytn-tx-latency-measurement/sendtx_klaytn.js @@ -128,7 +128,7 @@ async function checkBalance(addr) { const caver = new Caver(process.env.CAVER_URL) const balance = await caver.rpc.klay.getBalance(addr) const balanceInKLAY = caver.utils.convertFromPeb(balance, 'KLAY') - + const now = new Date(); if(parseFloat(balanceInKLAY) < parseFloat(process.env.BALANCE_ALERT_CONDITION_IN_KLAY)) { sendSlackMsg(`${now}, Current balance of <${process.env.SCOPE_URL}/account/${addr}|${addr}> is less than ${process.env.BALANCE_ALERT_CONDITION_IN_KLAY} KLAY! balance=${balanceInKLAY}`) } From 23faffdbb2721839e9de5bfcf38e17eddc66c99d Mon Sep 17 00:00:00 2001 From: ara-klaytn Date: Thu, 11 Jan 2024 15:33:22 +0800 Subject: [PATCH 2/2] Fixed polkadot (version update requires different method) --- polkadot-tx-latency-measurement/sendtx_polkadot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot-tx-latency-measurement/sendtx_polkadot.js b/polkadot-tx-latency-measurement/sendtx_polkadot.js index 12dabad..1b44dff 100644 --- a/polkadot-tx-latency-measurement/sendtx_polkadot.js +++ b/polkadot-tx-latency-measurement/sendtx_polkadot.js @@ -181,7 +181,7 @@ async function sendTx(){ data.resourceUsedOfLatestBlock = Math.round(weightUsed * (10**(-9))) // Create value transfer transaction. - const transfer = api.tx.balances.transfer(senderAddress, 0); + const transfer = api.tx.balances.transferAllowDeath(senderAddress, 0); // Sign transaction. await transfer.signAsync(sender);