properly identify methods to interact with

This commit is contained in:
fernandomg 2020-06-06 17:34:26 -03:00
parent cefb33b593
commit 7d83843b96
1 changed files with 2 additions and 2 deletions

View File

@ -32,10 +32,10 @@ export const getMethodSignatureAndSignatureHash = (
export const extractUsefulMethods = (abi: AbiItem[]): AbiItemExtended[] => {
return abi
.filter(({ constant, name, type }) => type === 'function' && !!name && typeof constant === 'boolean')
.filter(({ stateMutability, name, type }) => type === 'function' && !!name && stateMutability !== 'pure')
.map(
(method): AbiItemExtended => ({
action: method.constant ? 'read' : 'write',
action: method.stateMutability === 'view' ? 'read' : 'write',
...getMethodSignatureAndSignatureHash(method),
...method,
}),