Skip to content
This repository has been archived by the owner on Apr 18, 2021. It is now read-only.

Commit

Permalink
fix: abi-to-script front version template #1
Browse files Browse the repository at this point in the history
  • Loading branch information
JhChoy committed Oct 29, 2018
1 parent c9068e0 commit 2c30bb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions template/front.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ export default function(abi, web3) {
at: function(_addr) {
contract = contractForm.at(_addr);
},
{{#constantFuncs}}
{{name}}: function({{#inputs}}_{{name}}, {{/inputs}}callback) {
contract.{{name}}({{#inputs}}_{{name}}, {{/inputs}}callback);
getAddress: function() {
return contract.options.address;
},
{{/constantFuncs}}
{{#nonConstantFuncs}}
{{name}}: function({{#inputs}}_{{name}}, {{/inputs}}...args) {
contract.{{name}}({{#inputs}}_{{name}}, {{/inputs}}...args);
},
{{/nonConstantFuncs}}
methods: {
{{#constantFuncs}}
{{name}}: function({{#inputs}}_{{name}}, {{/inputs}}callback) {
contract.{{name}}({{#inputs}}_{{name}}, {{/inputs}}callback);
},
{{/constantFuncs}}
{{#nonConstantFuncs}}
{{name}}: function({{#inputs}}_{{name}}, {{/inputs}}...args) {
contract.{{name}}({{#inputs}}_{{name}}, {{/inputs}}...args);
},
{{/nonConstantFuncs}}
}
}
}
};
2 changes: 1 addition & 1 deletion template/frontIndex.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#apis}}import {{name}} from './{{name}}.js';
{{/apis}}
async function {{name}}(web3) {
export async function {{name}}(web3) {
const exportObject = {};
let abi;
Expand Down

0 comments on commit 2c30bb3

Please sign in to comment.