|
@@ -1,6 +1,5 @@
|
|
|
import { web3 } from "hardhat";
|
|
import { web3 } from "hardhat";
|
|
|
import deployer from '../.secret'
|
|
import deployer from '../.secret'
|
|
|
-const hre = require('hardhat')
|
|
|
|
|
|
|
|
|
|
describe('Univ3 Test', () => {
|
|
describe('Univ3 Test', () => {
|
|
|
it('Parse ether test', async () => {
|
|
it('Parse ether test', async () => {
|
|
@@ -12,11 +11,25 @@ describe('Univ3 Test', () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('Get balance test', async () => {
|
|
it('Get balance test', async () => {
|
|
|
- console.log(hre.network)
|
|
|
|
|
- console.log(deployer)
|
|
|
|
|
-
|
|
|
|
|
- // console.log(await web3.eth.getBalance(accountList[0]))
|
|
|
|
|
|
|
+ console.log(await web3.eth.getBalance(deployer.address))
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('Transfer test')
|
|
|
|
|
|
|
+ it('Transfer test', async () => {
|
|
|
|
|
+ let rawTx = {
|
|
|
|
|
+ nonce: await web3.eth.getTransactionCount(deployer.address),
|
|
|
|
|
+ gasPrice: web3.utils.toWei('2', 'gwei'),
|
|
|
|
|
+ gasLimit: 1_000_000,
|
|
|
|
|
+ to: '0x0000000000000000000000000000000000000000',
|
|
|
|
|
+ value: '0x05'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const signedObj = await web3.eth.accounts.signTransaction(rawTx, deployer.private)
|
|
|
|
|
+ if (signedObj.rawTransaction != null) {
|
|
|
|
|
+ console.log('ready send hash: ' + signedObj.transactionHash)
|
|
|
|
|
+ await web3.eth.sendSignedTransaction(signedObj.rawTransaction).on('error', function (rst) {
|
|
|
|
|
+ console.error(rst)
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('sent finish.')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|