Skip to Content
Ethereum Smart Contract Development
book

Ethereum Smart Contract Development

by Mayukh Mukhopadhyay
February 2018
Intermediate to advanced
288 pages
6h 58m
English
Packt Publishing
Content preview from Ethereum Smart Contract Development

Reading tweets

By post-mining the smart contracts, the functions can be used from smart contract accounts to read the tweets posted by users on the private blockchain. Here, we are showing a different variant by using the remix browser in Figure 9.18. We deploy three tweets on the blockchain as a test:

Tweet0: "Hello Blockchain."

Tweet1: "Hello Ethereum."

Tweet2: "This is a junk tweet which contains spurious characters in order to exceed the 160 character limit which is being used as a negative test case and check the correctness of the smart contract operation."

We can see in Figure 9.18 the number of tweets returns only two because the third tweet gets rejected:

Figure 9.18: Tweeter smart contract testing using remix browser
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers

Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers

Kedar Iyer, Chris Dannen

Publisher Resources

ISBN: 9781788473040Supplemental Content