Skip to content

Commit

Permalink
style: format code with Autopep8, Black, ClangFormat, dotnet-format, …
Browse files Browse the repository at this point in the history
…Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf

This commit fixes the style issues introduced in eb12002 according to the output
from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java
Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt,
Scalafmt, StandardJS, StandardRB, swift-format and Yapf.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored May 10, 2024
1 parent eb12002 commit d5de687
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions src/middleware/network.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
const { PRIVATE_KEY, PRIVATE_KEY_PASSWORD, PRIVATE_KEY_PASSWORD_SALT, ENDPOINT, CHAIN_ID } = process.env;
const {
PRIVATE_KEY,
PRIVATE_KEY_PASSWORD,
PRIVATE_KEY_PASSWORD_SALT,
ENDPOINT,
CHAIN_ID
} = process.env

const Web3 = require("web3");
const EthereumTx = require("ethereumjs-tx");
const Web3 = require('web3')
const EthereumTx = require('ethereumjs-tx')

const web3 = new Web3(new Web3.providers.HttpProvider(ENDPOINT));
const web3 = new Web3(new Web3.providers.HttpProvider(ENDPOINT))

const createTransaction = async (from, to, value) => {
const nonce = await web3.eth.getTransactionCount(from);
const gasPrice = await web3.eth.getGasPrice();
const gasLimit = 21000;
const nonce = await web3.eth.getTransactionCount(from)
const gasPrice = await web3.eth.getGasPrice()
const gasLimit = 21000

const tx = new EthereumTx({
nonce,
gasPrice,
gasLimit,
to,
value,
});
value
})

const privateKey = web3.utils.sha3(PRIVATE_KEY_PASSWORD + PRIVATE_KEY_PASSWORD_SALT);
tx.sign(privateKey);
const privateKey = web3.utils.sha3(
PRIVATE_KEY_PASSWORD + PRIVATE_KEY_PASSWORD_SALT
)
tx.sign(privateKey)

const serializedTx = tx.serialize();
const transactionHash = await web3.eth.sendSignedTransaction("0x" + serializedTx.toString("hex"));
const serializedTx = tx.serialize()
const transactionHash = await web3.eth.sendSignedTransaction(
'0x' + serializedTx.toString('hex')
)

return transactionHash;
};
return transactionHash
}

module.exports = createTransaction;
module.exports = createTransaction

0 comments on commit d5de687

Please sign in to comment.