CRYPTO NEWS

How to chain functions in truffle framework?

I am wondering how to chain functions in truffle testing framework to avoid writing the same code twice.

To give an example, I am experimenting with the old version of King of the Ether Throne contract. The test I want to run is simple claiming of the throne by different accounts. There is a snippet from it (with pretty much the same code written twice for two claims of a throne)

it("testing few interactions between external accounts and the contract", function(){         var kingOfEtherInstance;         var currentMonarchAddress;         var currentClaimPrice;         return KingOfEtherContract.new()         .then(function(instance){             kingOfEtherInstance = instance;             return kingOfEtherInstance.currentMonarch.call();         })         .then(function(monarch){             console.log(monarch);             console.log("current monarch: "+monarch[0]);             console.log("price paid: "+monarch[2].valueOf());             return kingOfEtherInstance.currentClaimPrice.call();         })         .then(function(price){             currentClaimPrice = price;             return kingOfEtherInstance.claimThrone("king", {from: accounts[1], to: kingOfEtherInstance.address, value: currentClaimPrice, gas:800000, data: "king"});         })         .then(function(){             console.log("after a transaction was sentn");             return kingOfEtherInstance.currentMonarch.call();         })          .then(function(monarch){             console.log(monarch);             console.log("current monarch: "+monarch[0]);             console.log("price paid: "+monarch[2].valueOf());              return kingOfEtherInstance.currentClaimPrice.call();                         })         .then(function(price){             currentClaimPrice = price;            return kingOfEtherInstance.claimThrone("king", {from: accounts[1], to: kingOfEtherInstance.address, value: currentClaimPrice, gas:800000, data: "king"});         })         .then(function(){             console.log("after a transaction was sentn");             return kingOfEtherInstance.currentMonarch.call();         })          .then(function(monarch){             console.log(monarch);             console.log("current monarch: "+monarch[0]);             console.log("price paid: "+monarch[2].valueOf());          });     }); 

I tried few approaches for chaining those calls, but it always behaved as if they were not chained (so it would produce two same results).

Is there an example of chained functions in truffle?

Intel Ships Blockscale ASIC Chips To Selected Bitcoin Mining Companies

It’s official, Intel is part of the bitcoin mining business. The gargantuan technology company announced its “ultra-low-voltage energy-efficient” ASIC chip barely six months ago, and it’s already here. Under normal circumstances, infrastructural support from a multinational company like Intel would be tremendous for the bitcoin market. How will it react in the middle of all::Listen

It’s official, Intel is part of the bitcoin mining business. The gargantuan technology company announced its “ultra-low-voltage energy-efficient” ASIC chip barely six months ago, and it’s already here. Under normal circumstances, infrastructural support from a multinational company like Intel would be tremendous for the bitcoin market. How will it react in the middle of all this chaos? Will it react at all? The news didn’t immediately do much, but the long-term effect remains to be seen.

Raja Koduri, Intel’s Architecture, Graphics and Software (IAGS) division’s senior vice president, recently tweeted: 

“Intel AXG Custom Compute team is now shipping the Blockscale ASIC! First product will always be unforgettable, congratulations team. Excited to see how Argo, Griid and Hive improvise around Blockscale and our open design.”

Notably absent from the list is BLOCK, Jack Dorsey’s company. Does that mean something or is BLOCK just fourth on the list? Three months ago, Bitcoinist quoted Raja Koduri emphatically saying:

“Our blockchain accelerator will ship later this year. We are engaged directly with customers that share our sustainability goals. Argo Blockchain, BLOCK (formerly known as Square) and GRIID Infrastructure are among our first customers for this upcoming product.”

The Bitcoin Miners React To Intel’s Announcement

Green mining company Hive was the first to react, they tweeted “HIVE is proud to have partnered with Intel, and we can’t wait to put the new ASICs to good use mining BTC!” A few months ago, the company was much more eloquent in a press release NewsBTC quoted. “These miners are expected to be delivered over a period of one year starting in the second half of calendar 2022, the effect of which, if they are all installed, would be an expected increase of up to 95% in our aggregate Bitcoin mining hashrate from 1.9 Exahash per second.”

For their part, Argo also went the simple route and tweeted. “Thanks, Raja Koduri and Intel. We’re excited to be innovating with these new ASIC chips in our custom immersion mining rigs. Our thanks to ePIC Blockchain for joining us on the ride.” That new player, ePIC Blockchain Technologies produces self-proclaimed “North American Designed ASIC RIGs.” So, innovation and customization are on the way.

Last but not least, let’s remember Raja Koduri’s words when Intel’s bitcoin mining experiment started: 

“Today, we at Intel are declaring our intent to contribute to the development of blockchain technologies, with a roadmap of energy-efficient accelerators. Intel will engage and promote an open and secure blockchain ecosystem and will help advance this technology in a responsible and sustainable way.”  

Remember that statement as we pass to the next section.

BTC price chart for 07/04/2022 on Bitfinex | Source: BTC/USD on TradingView.com
Mainstream Media Mocks Intel

In the eyes of mainstream media, bitcoin or anything related to it can’t do anything right. And this bear-market-of-sorts we’re into gives them the perfect ammunition to attack the technology and the billion-dollar market around it. Luckily, bitcoin doesn’t care. In the first mainstream article about Intel shipping its Blockscale ASIC chips ahead of time, The Register starts with valuable information:

“Blockscale is shipping a couple days ahead of Intel’s previously stated release window for the third quarter, which begins Friday. Even if it’s a tiny head start, it is nonetheless an achievement for a corporation that is becoming notoriously under-schedule across multiple products, including the Sapphire Rapids server chips and the discrete Arc GPUs.”

Only to then, start dunking on bitcoiners and Intel alike. They start with this:

“Experts and company officials are warning that the world of blockchain-fueled digital currencies is entering a crypto winter, a period where the value of virtual coins plunge and remain low. This last happened between early 2018 and mid-2020.”

And then, they dedicate 1000 words to the market’s condition instead of discussing Intel’s SEG energy-efficient intentions. Or the perfectly executed roll-out strategy that the company exhibited these last few months. Or the fact that bitcoin is humanity’s only hope.

Featured Image: Blockscale promotional image from this tweet | Charts by TradingView

How to chain functions in truffle framework?

Shopping cart
There are no products in the cart!
Continue shopping
0