ContractWrapper.jsx 1.0 KB

12345678910111213141516171819202122
  1. //takes compiled code, instance and template.
  2. var ContractWrapper = React.createClass({
  3. render: function() {
  4. return (
  5. <div>
  6. <ul>
  7. {this.props.compiled.info.abiDefinition.map(function(result) {
  8. if(result.type == "function") { //TODO: Determine whether events can be called from outside, otherwise it should be included.
  9. //react key = unique function name for contract.
  10. var function_template = {};
  11. if (this.props.contract_template.hasOwnProperty(result.name)) { //if a specific function has a template for it.
  12. function_template = this.props.contract_template[result.name];
  13. }
  14. return <FunctionWrapper function_template={function_template} instance={this.props.instance} key={result.name} data={result}/>;
  15. }
  16. }, this)}
  17. </ul>
  18. </div>
  19. );
  20. }
  21. });