Class EvmXmlRenderer
java.lang.Object
net.finmath.smartcontracts.representablestate.xml.EvmXmlRenderer
- All Implemented Interfaces:
ContractStateXmlRenderer
Reference implementation of an XML renderer for IXMLRepresentableState and IXMLRepresentableStatePart
Supported XML Schemata:
- Core scalar profile
- Multi-binding attributes (evmstate:calls)
- Array binding profile for scalar and tuple arrays via evmstate:item-element + evmstate:item-field
- XML-Complete state: stateXmlTemplate()
- Partial state: statePartXmlTemplate(uint256 partId)
- Author:
- Christian Fries
-
Constructor Summary
ConstructorsConstructorDescriptionEvmXmlRenderer(String rpcUrl) Instantiate a renderer connected to a given chain's RPC URL. -
Method Summary
Modifier and TypeMethodDescriptionExtract the XML from a given contract address, executing the required calls to populate the bindings.render(String contractAddress, BigInteger blockNumber) Extract the XML from a given contract address, executing the required calls to populate the bindings.render(String contractAddress, BigInteger blockNumber, BigInteger partId) Extract the XML representing the state (either xml-complete or partial) from a given contract address at a given block, executing the required calls to populate the bindings.renderPart(String contractAddress, BigInteger partId) Extract the XML from a given contract address, executing the required calls to populate the bindings.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.finmath.smartcontracts.representablestate.xml.ContractStateXmlRenderer
renderPart
-
Constructor Details
-
EvmXmlRenderer
Instantiate a renderer connected to a given chain's RPC URL.- Parameters:
rpcUrl- The RPC URL of the chain.
-
-
Method Details
-
render
Description copied from interface:ContractStateXmlRendererExtract the XML from a given contract address, executing the required calls to populate the bindings.- Specified by:
renderin interfaceContractStateXmlRenderer- Parameters:
contractAddress- A given contract address as hex 0x1234567...- Returns:
- The XML representing the current contract state.
- Throws:
Exception- An exception.
-
render
Description copied from interface:ContractStateXmlRendererExtract the XML from a given contract address, executing the required calls to populate the bindings.- Specified by:
renderin interfaceContractStateXmlRenderer- Parameters:
contractAddress- A given contract address as hex 0x1234567...blockNumber- The block number to fix for receiving the template and the state values.- Returns:
- The XML representing the current contract state.
- Throws:
Exception- An exception.
-
renderPart
Description copied from interface:ContractStateXmlRendererExtract the XML from a given contract address, executing the required calls to populate the bindings.- Specified by:
renderPartin interfaceContractStateXmlRenderer- Parameters:
contractAddress- A given contract address as hex 0x1234567...partId- If null, the xml-complete template stateXmlTemplate is used, if non-null the partial templates statePartXmlTempate is used- Returns:
- The XML representing the current contract state.
- Throws:
Exception- An exception.
-
render
public String render(String contractAddress, BigInteger blockNumber, BigInteger partId) throws Exception Description copied from interface:ContractStateXmlRendererExtract the XML representing the state (either xml-complete or partial) from a given contract address at a given block, executing the required calls to populate the bindings.- Specified by:
renderin interfaceContractStateXmlRenderer- Parameters:
contractAddress- A given contract address as hex 0x1234567...blockNumber- The block number to fix for receiving the template and the state values.partId- If null, the xml-complete templatestateXmlTemplateis used, if non-null the partial templatesstatePartXmlTempateis used.- Returns:
- The XML representing the current contract state.
- Throws:
Exception- An exception.
-