|
|
@@ -33,6 +33,14 @@ async function test6() {
|
|
|
headers: {'Content-type': 'application/json'}
|
|
|
})
|
|
|
}
|
|
|
+async function test7() {
|
|
|
+ // @ts-ignore
|
|
|
+ await web3.eth.ethCall({
|
|
|
+ 'from':'0x1712B216FdD1943E5FCd75ec945588dDB4765c0f',
|
|
|
+ 'to':'0xe0208a3B4C3cd0583F04fB002ebD5dCDd0D3FEB5',
|
|
|
+ 'data':'0x0ad5a3af0000000000000000000000008b4a890b407c0a2e85a5c915546b8d9aeb731b98000000000000000000000000053b77ac4f8ef8d19830a429fa55e56a7529fac100000000000000000000000000000000000000000000000000000000000006a40000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000cb730e11b12beab590b623a83534803491059ede00000000000000000000000000000000000000000000000000038d7ea4c68000'
|
|
|
+ }, "latest")
|
|
|
+}
|
|
|
|
|
|
async function run(fun: Function) {
|
|
|
const startTs = new Date().getTime()
|
|
|
@@ -51,8 +59,10 @@ async function run(fun: Function) {
|
|
|
}
|
|
|
|
|
|
async function main() {
|
|
|
+ const testCount = 10
|
|
|
+
|
|
|
logger.debug('web3 getBlockNumber:')
|
|
|
- for (let i = 0; i < 5; i++) {
|
|
|
+ for (let i = 0; i < testCount; i++) {
|
|
|
await run(test4)
|
|
|
}
|
|
|
|
|
|
@@ -67,15 +77,32 @@ async function main() {
|
|
|
]
|
|
|
})
|
|
|
logger.debug('web3 getBlockNumber2.send():')
|
|
|
- for (let i = 0; i < 5; i++) {
|
|
|
+ for (let i = 0; i < testCount; i++) {
|
|
|
await run(test5)
|
|
|
}
|
|
|
|
|
|
|
|
|
- logger.debug('web3 http test.')
|
|
|
- for (let i = 0; i < 5; i++) {
|
|
|
+
|
|
|
+ logger.debug('web3 http,http,http,http,http test.')
|
|
|
+ for (let i = 0; i < testCount; i++) {
|
|
|
await run(test6)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ web3.extend({
|
|
|
+ property: 'eth',
|
|
|
+ methods: [
|
|
|
+ {
|
|
|
+ name: 'ethCall',
|
|
|
+ call: 'eth_call',
|
|
|
+ params: 2
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ logger.debug('web3 call,call,call,call,call test.')
|
|
|
+ for (let i = 0; i < testCount; i++) {
|
|
|
+ await run(test7)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
main().catch((error) => {
|