November 2018
Intermediate to advanced
528 pages
13h 21m
English
For view methods (which only read a value in a smart contract), they are invoked using an ordinary method call, except they will not return a TransactionReceipt as no transaction will be initiated (no cost associated). In our smart contract, we have a view method, offset(), that can be invoked as follows:
BigInteger Offset=CFutureInstance.offset().send();log.info("your offset is "+Offset.intValue());
In the same manner, it is possible to query the public states of a smart contract, for instance to read the last fuelPriceUSD state's value:
BigInteger LastfuelPrice = CFutureInstance.fuelPriceUSD().send();Integer fuelPriceUSD = LastfuelPrice.intValue();log.info("Last fuel Price Fuel price According to the Oracle is: " + ...Read now
Unlock full access