Skip to content

Commit

Permalink
Updated event names in SSE client part
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Zajkowski committed Jun 24, 2024
1 parent 8e02918 commit 4c99659
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion run_e2e_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export VERSION_QUERY='{"jsonrpc": "2.0", "id": "1", "method": "info_get_status"}
export MAINNET_NODE_URL='https://rpc.mainnet.casperlabs.io/rpc'
export TESTNET_NODE_URL='https://rpc.testnet.casperlabs.io/rpc'

yarn cross-env NODE_ENV=test TS_NODE_FILES=true mocha -r ts-node/register \"e2e/**/*.test.ts\" --timeout 50000 --exit
yarn cross-env NODE_ENV=test TS_NODE_FILES=true mocha -r ts-node/register \"e2e/**/*.test.ts\" --timeout 500000 --exit
13 changes: 5 additions & 8 deletions src/services/EventStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class DeployWatcher {
}

start() {
this.es.subscribe(EventName.DeployProcessed, result => {
const deployHash = result.body.DeployProcessed.deploy_hash;
this.es.subscribe(EventName.TransactionProcessed, result => {
const deployHash = result.body.TransactionProcessed.deploy_hash;
const pendingDeploy = this.watchList.find(
d => d.deployHash === deployHash
);
Expand All @@ -55,14 +55,11 @@ export class DeployWatcher {
type EventHandlerFn = (result: any) => void;

export enum EventName {
/** Can be fetched in `/events/main` path */
BlockAdded = 'BlockAdded',
/** Can be fetched in `/events/main` path */
DeployProcessed = 'DeployProcessed',
/** Can be fetched in `/events/deploys` path */
DeployAccepted = 'DeployAccepted',
TransactionProcessed = 'TransactionProcessed',
TransactionAccepted = 'TransactionAccepted',
TransactionExpired = 'TransactionExpired',
BlockFinalized = 'BlockFinalized',
/** Can be fetched in `/events/sigs` path */
FinalitySignature = 'FinalitySignature',
Fault = 'Fault'
}
Expand Down

0 comments on commit 4c99659

Please sign in to comment.