Skip to content

Commit

Permalink
restrict ReadEventArgumentFuture types
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeyTM committed Sep 12, 2023
1 parent ccca4ae commit be05303
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/core/src/internal/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ export class ReadEventArgumentFutureImplementation
constructor(
public readonly id: string,
public readonly module: IgnitionModuleImplementation,
public readonly futureToReadFrom: Future,
public readonly futureToReadFrom:
| NamedContractDeploymentFuture<string>
| ArtifactContractDeploymentFuture
| NamedContractCallFuture<string, string>,
public readonly eventName: string,
public readonly argumentName: string,
public readonly emitter: ContractFuture<string>,
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/stored-deployment-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ import {
AccountRuntimeValue,
AddressResolvableFuture,
ArgumentType,
ArtifactContractDeploymentFuture,
ContractFuture,
Future,
FutureType,
IgnitionModule,
IgnitionModuleResult,
ModuleParameterRuntimeValue,
ModuleParameterType,
NamedContractCallFuture,
NamedContractDeploymentFuture,
RuntimeValueType,
} from "./types/module";
import {
Expand Down Expand Up @@ -787,7 +790,10 @@ export class StoredDeploymentDeserializer {
this._lookup(
futuresLookup,
serializedFuture.futureToReadFrom.futureId
),
) as
| NamedContractDeploymentFuture<string>
| ArtifactContractDeploymentFuture
| NamedContractCallFuture<string, string>,
serializedFuture.eventName,
serializedFuture.argumentName,
this._lookup(
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/types/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ export interface ReadEventArgumentFuture {
id: string;
module: IgnitionModule;
dependencies: Set<Future>;
futureToReadFrom: Future;
futureToReadFrom:
| NamedContractDeploymentFuture<string>
| ArtifactContractDeploymentFuture
| NamedContractCallFuture<string, string>;
eventName: string;
argumentName: string;
emitter: ContractFuture<string>;
Expand Down

0 comments on commit be05303

Please sign in to comment.