@sentio/sdk 1.7.22 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,14 @@
1
- import { ProcessorState, setProvider } from '@sentio/sdk'
1
+ import { ProcessorState } from '@sentio/sdk'
2
2
  import { getERC20TokenInfo } from './erc20'
3
+ import { loadTestProvidersFromEnv } from '../test'
3
4
 
4
5
  describe('erc20 tests', () => {
5
- beforeAll(async () => {
6
- global.PROCESSOR_STATE = new ProcessorState()
6
+ global.PROCESSOR_STATE = new ProcessorState()
7
+ const haveProviders = loadTestProvidersFromEnv('1')
7
8
 
8
- setProvider({
9
- '1': {
10
- ChainID: '1',
11
- Https: ['https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2'], // Use env
12
- },
13
- })
14
- })
9
+ const testIf = haveProviders ? test : test.skip
15
10
 
16
- test('test bytes32', async () => {
11
+ testIf('test bytes32', async () => {
17
12
  const info = await getERC20TokenInfo('0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2')
18
13
 
19
14
  expect(info.decimal).toEqual(18)
@@ -21,7 +16,7 @@ describe('erc20 tests', () => {
21
16
  expect(info.name).toEqual('Maker')
22
17
  })
23
18
 
24
- test('test normal', async () => {
19
+ testIf('test normal', async () => {
25
20
  const info = await getERC20TokenInfo('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')
26
21
 
27
22
  expect(info.decimal).toEqual(6)