Skip to content

Commit

Permalink
fix: remove duplicate code now that sendUnsigned is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCap08055 committed Dec 30, 2024
1 parent b515dce commit f4874d9
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions e2e/scaffolding/extrinsicHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,27 +264,7 @@ export class Extrinsic<N = unknown, T extends ISubmittableResult = ISubmittableR
public async fundAndSendUnsigned(source: KeyringPair) {
await this.fundOperation(source);
log('Fund and Send', `Fund Source: ${getUnifiedAddress(source)}`);
const op = this.extrinsic();
try {
return await firstValueFrom(
op.send().pipe(
tap((result) => {
// If we learn a transaction has an error status (this does NOT include RPC errors)
// Then throw an error
if (result.isError) {
throw new CallError(result, `Failed Transaction for ${this.event?.meta.name || 'unknown'}`);
}
}),
filter(({ status }) => status.isInBlock || status.isFinalized),
this.parseResult(this.event)
)
);
} catch (e) {
if ((e as any).name === 'RpcError') {
console.error("WARNING: Unexpected RPC Error! If it is expected, use 'current' for the nonce.");
}
throw e;
}
return this.sendUnsigned();
}

public async sendUnsigned() {
Expand Down

0 comments on commit f4874d9

Please sign in to comment.