Questions tagged [async]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Async call to GetBlockWithTransactionsByNumber frequently returns 'NULL' block (Nethereum)

Calling GetBlockWithTransactionsByNumber asynchronoulsy from within a ProcessorForContract frequently returns NULLs. If I execute the following: HexBigInteger blockNumber = new HexBigInteger(sl.Log....
Kodo's user avatar
  • 101
3 votes
1 answer
185 views

Where to position 'await' statement in Hardhat tests?

According to Hardhat Tutorial, while writing tests, some cases are written like expect(await hardhatToken.totalSupply()).to.equal(ownerBalance); while others are written await expect(hardhatToken....
errata's user avatar
  • 139
0 votes
1 answer
38 views

async await keywords

While writing JS code ( For instance, a huge function that consists of multiple commands meant to interact with the Blockchain ) to talk to smart contracts ( Interactions like reading and writing to ...
Sina Rahimi's user avatar
1 vote
0 answers
146 views

What is the use case of web3's AsyncHTTPProvider?

Is the only reason to be able to use asynchronous code when fetching data from a Node? Wouldn't I be able to use async code just using a more normal Websocket/IPC/HTTPProvider?
Hiperfly's user avatar
1 vote
1 answer
95 views

How to handle two solidity events with asyncio python

Im trying to get every Swap event happens on Uniswap and Sushiswap using python and do stuff based on these Swaps i know how to do it but with one exchange, it means that only one event in time . from ...
noro meb's user avatar
  • 328
4 votes
2 answers
47 views

Is there ever going to be some kind of parallelism in Ethereum or any L2?

Suppose I have a long array of values: x = [1, 2, 3, ..., N] # shape [N, ] array and a function def f(x): return x ** 2 then I'd do something like (similar to python's multiprocessing) with ...
H. Arponen's user avatar
0 votes
1 answer
282 views

Smart Contract test wont passed event though the value that needed to pass to the expect block already exist

So as the title suggested i tested a smart contract (ERC721) but the the test wont pass. I am using hardhat environment for testing, that is hardhat-waffle and chai library. Here is the smart contract ...
Muhammad's user avatar
1 vote
0 answers
108 views

Does (Ethereum) blockchain handle request truly asynchronously?

So, if we send 100 simultaneous requests to a web server, there would be 100 threads spawn to serve these 100 requests. That's what I'd call asynchronous handling. Now, 100 transactions are created ...
tab87vn's user avatar
  • 111
1 vote
1 answer
994 views

Error handling with ethers.js

I've got a getContract function that looks something like this. const getContract = async () => { const provider = new ethers.providers.InfuraProvider(process.env.NETWORKS, process.env....
Luka Lazarevic's user avatar
1 vote
0 answers
1k views

How to use AsyncHTTPProvider in web3py?

I am trying to use the AsyncHTTPProvider in a project, and here is my test code: import asyncio from web3 import Web3 import asyncio async def main(): w3 = Web3(Web3.AsyncHTTPProvider("http://...
NoNam4's user avatar
  • 111
0 votes
0 answers
682 views

How to program an NFT with multiple layers?

NFTs with multiple layers are being made now. e.g. an NFT made of different images sometimes owned by different artists. These NFTs are referred to as programmable NFTs, async NFTs and or dynamic NFTs....
scranley's user avatar
  • 101
0 votes
1 answer
462 views

"Undefined" when trying to use async/await/promise

I'm currently trying to put in the function: truffle console truffle (development) > const token = await Token.deployed() And the result is coming up as undefined. I've started over my DAPP project ...
Stamyr's user avatar
  • 1
1 vote
1 answer
474 views

Web3 returning Promise instead of value? [closed]

I have a simple async/await function get the total supply of my contract. It returns a promise, however. async function supply() { const supply = await contract.methods.totalSupply().call() ...
greentriangles1's user avatar
1 vote
0 answers
330 views

In Python, how do I use subscriptions, or otherwise perform asynchronous operations?

I have the following code that polls for transactions every second. I want to make it more responsive, and not use polling, but instead something quicker. tx_all_pending = w3.eth.filter('pending') ...
abtree's user avatar
  • 141
0 votes
2 answers
1k views

How to get transaction hash without waiting for await call?

for my demo I need the transaction hash instantly without waiting for callback of sync call. Here my code: aggiungiAllaBlockChain: async(u,n,c,e) => { try { const web3 = new Web3(App....
alfo888_ibg's user avatar
0 votes
1 answer
398 views

Test.js Function Event Logs Return Empty Array - Async/Await/Promise/Tronweb Issue

I'm working on a Tron smart contract and am providing a function in my tests file which emits to an event. When trying to console.log the logs I get an empty array. Is this because of lag for the ...
Crypto Stamina's user avatar
0 votes
1 answer
195 views

Cannot read property in event object

I am attempting to collect event information from a contract. When I call the event, I am attempting to collect a specific return value event.returnValue.pubkey. When I run the code below, I get the ...
Julian Martinez's user avatar
1 vote
1 answer
476 views

Truffle Contract sendTransaction not immediately returning transaction hash

I am using Truffle Contract to call a Smart Contract method that writes to the ethereum blockchain. My web3 client is connected to my own Open Ethereum node. Below is the code (nodejs) that I am using ...
Kevin Melberger's user avatar
0 votes
1 answer
95 views

Is using oraclize to schedule using execution of a function asynchronous?

I am looking for ways to automatically execute a function call every 24 hours in my smart contract and came across this answer. Is the solution here asynchronous, i.e. can the contract execute other ...
Guiomar Raissa's user avatar
1 vote
1 answer
176 views

Exit process after sending multiple tx asynchronously

I have written a function that allows me to send an arbitrary amount of transactions, asynchronously, to my smart contract. However the process stays open even after the last transaction has finished. ...
Conviley's user avatar
  • 390