capi icon indicating copy to clipboard operation
capi copied to clipboard

rethinking senderProxyId

Open ryanleecode opened this issue 2 years ago • 0 comments

In VirtualMultisigRune there is a senderProxyId method with the following code snippet

  senderProxyId<X>(...[senderAccountId]: RunicArgs<X, [senderAccountId: Uint8Array]>) {
    const senderAccountIdHex = Rune.resolve(senderAccountId).map(hex.encode)
    const senderProxyI = this.proxies.access(senderAccountIdHex)
    const senderProxyAccountId = this.inner
      .into(ValueRune)
      .access("signatories")
      .access(senderProxyI)
    return MultiAddress.Id(senderProxyAccountId)
  }

In the event that there is no sender proxy id it returns { type: 'Id', value: undefined }. Would it be better to just return undefined if the inner value is undefined? This is also good because they can just do unhandle(undefined)

ryanleecode avatar May 02 '23 16:05 ryanleecode