@@ -22,6 +22,7 @@ import { Network, Project } from '../entity/Contract';
2222import { EventSubscription , EventSubscriberAttrs } from '../entity/EventSubscription' ;
2323import { EncryptorContainer } from '../entity/encryption/EncryptorContainer' ;
2424import { AbstractEthereumService } from "../eth/AbstractEthereumService" ;
25+ import { LoomHooks } from "../eth/LoomHooks" ;
2526
2627const request = require ( 'request' ) ;
2728const config = require ( 'config' ) ;
@@ -89,6 +90,7 @@ export const EventSubscriptionEntityTests = async function() {
8990
9091 const subscriberAttrs = new EventSubscriberAttrs ( ) ;
9192 subscriberAttrs . project = 'ShipToken' ;
93+ subscriberAttrs . version = '1.0.0' ;
9294 subscriberAttrs . url = ES_NODE ;
9395 subscriberAttrs . receiverType = 'ELASTIC' ;
9496
@@ -98,9 +100,12 @@ export const EventSubscriptionEntityTests = async function() {
98100 const ETH = 10 ** 18 ;
99101 const TOTAL = 500 * SHIP ;
100102
101- expect ( Number ( await local . ShipToken . call_static ( 'balanceOf' , [ await owner . asyncEvmAddress ] ) ) ) . toEqual ( TOTAL ) ;
103+ const ownerBalance = await local . ShipToken . call_static ( 'balanceOf' , [ await owner . asyncEvmAddress ] ) ;
104+ expect ( Number ( ownerBalance ) ) . toEqual ( TOTAL ) ;
102105
103- expect ( Number ( await ethereumService . getBalance ( await owner . asyncEvmAddress ) ) ) . toEqual ( 5 * ETH ) ;
106+ if ( ! LoomHooks . enabled ) {
107+ expect ( Number ( await ethereumService . getBalance ( await owner . asyncEvmAddress ) ) ) . toEqual ( 5 * ETH ) ;
108+ }
104109
105110 const txParams = await owner . add_tx_params (
106111 network ,
@@ -148,9 +153,9 @@ export const EventSubscriptionEntityTests = async function() {
148153
149154 //console.log('ElasticSearch Events:', results)
150155
151- expect ( results [ 'hits' ] [ 'total' ] ) . toEqual ( 4 ) ;
156+ expect ( results [ 'hits' ] [ 'total' ] [ 'value' ] ) . toEqual ( 4 ) ;
152157
153158 } ,
154- 30000 , // This one can be a bit slow...
159+ 60000 , // This one can be a bit slow...
155160 ) ;
156161} ;
0 commit comments