Commit 0b67aa95 authored by yann300's avatar yann300

rollback uneeded refactoring

parent 7f9e48c3
...@@ -102,14 +102,10 @@ export function extractSize (type) { ...@@ -102,14 +102,10 @@ export function extractSize (type) {
return size ? size[2] : '' return size ? size[2] : ''
} }
export function getError (abi, fnName) { export function getFunction (abi, fnName) {
return getFromInterface(abi, fnName, 'error')
}
export function getFromInterface (abi, fnName, type) {
for (let i = 0; i < abi.length; i++) { for (let i = 0; i < abi.length; i++) {
const fn = abi[i] const fn = abi[i]
if (fn.type === type && fnName === fn.name + '(' + fn.inputs.map((value) => { if (fn.type === 'function' && fnName === fn.name + '(' + fn.inputs.map((value) => {
if (value.components) { if (value.components) {
const fullType = this.makeFullTypeDefinition(value) const fullType = this.makeFullTypeDefinition(value)
return fullType.replace(/tuple/g, '') // return of makeFullTypeDefinition might contain `tuple`, need to remove it cause `methodIdentifier` (fnName) does not include `tuple` keyword return fullType.replace(/tuple/g, '') // return of makeFullTypeDefinition might contain `tuple`, need to remove it cause `methodIdentifier` (fnName) does not include `tuple` keyword
...@@ -123,10 +119,6 @@ export function getFromInterface (abi, fnName, type) { ...@@ -123,10 +119,6 @@ export function getFromInterface (abi, fnName, type) {
return null return null
} }
export function getFunction (abi, fnName) {
return getFromInterface(abi, fnName, 'function')
}
export function getFallbackInterface (abi) { export function getFallbackInterface (abi) {
for (let i = 0; i < abi.length; i++) { for (let i = 0; i < abi.length; i++) {
if (abi[i].type === 'fallback') { if (abi[i].type === 'fallback') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment