Skip to content

Commit 4e7202e

Browse files
committed
Finish contracts test
1 parent a2dc6af commit 4e7202e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/contracts.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const EtherscanAPI = require('../build')
2+
3+
describe('Etherscan contracts methods', () => {
4+
const e = new EtherscanAPI()
5+
6+
test('getContractAbi', async () => {
7+
const abi = await e.getContractAbi(
8+
'0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413'
9+
)
10+
expect(Array.isArray(abi)).toBe(true)
11+
expect(
12+
['function', 'constructor', 'event', 'fallback'].includes(abi[0].type)
13+
).toBe(true)
14+
// console.log(abi)
15+
})
16+
})

0 commit comments

Comments
 (0)