Skip to content

Commit

Permalink
fix: support old ABI and payable (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
nachomazzara authored and cazala committed Mar 21, 2019
1 parent d93d321 commit 9a8d899
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/contracts/artifacts/LANDRegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1260,4 +1260,4 @@
"type": "function"
}
]
}
}
7 changes: 3 additions & 4 deletions src/contracts/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,19 @@ export function fulfillContractMethods(instance: Contract, abi: ABIMethod[]) {
}

function createMethod(instance: Contract, method: ABIMethod, args: string) {
const { name, stateMutability, type } = method
const { name, stateMutability, type, constant } = method

switch (type) {
case 'function': {
if (stateMutability === 'view' || stateMutability === 'pure') {
if (stateMutability === 'view' || stateMutability === 'pure' || constant) {
return function() {
return instance.sendCallByType(name, args, ...arguments)
}
} else if (stateMutability === 'nonpayable') {
} else {
return function() {
return instance.sendTransactionByType(name, args, ...arguments)
}
}
break
}
}

Expand Down

0 comments on commit 9a8d899

Please sign in to comment.