Skip to content

Bug/dead-code: StreamsModule.callerAddr is never read and is miscomputed as ZERO_ADDR for async wallet adapters #520

Description

@Jaydbrown

src/streams.ts:77 declares private readonly callerAddr: string; and :108 sets this.callerAddr = this._signerPublicKey() in the constructor.

  • Never read. Every method uses _getSenderAddress() / _resolveCallerAddress() or a local callerAddr. grep -n 'this.callerAddr' src/ shows only the write.
  • Miscomputed. _signerPublicKey() (:131-139) calls this.activeWallet.getPublicKey() synchronously and only keeps the result if (typeof pk === 'string'). WalletAdapter.getPublicKey() may return Promise<string> (the async branch in _resolveCallerAddress handles exactly that), in which case _signerPublicKey falls through to ZERO_ADDR.

Impact

Dead field carrying a wrong value. Harmless today only because nothing reads it — a latent trap for anyone who wires it in.

Suggested fix

Delete the field, or make it a lazily-resolved cache that shares _resolveCallerAddress's async path.

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority: mediumMissing feature or UX issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions