Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MultiChainSigner.signAndPost to take multiple transactions #726

Open
webmaster128 opened this issue Jan 25, 2019 · 3 comments
Open

Comments

@webmaster128
Copy link
Contributor

This is required by the faucet (refilling distributors) to remove the need to wait for a block just to get an updated nonce

@webmaster128 webmaster128 self-assigned this Jan 27, 2019
@webmaster128
Copy link
Contributor Author

This is how an overload for one or many can work:

/**
   * Queries the nonce, signs the transaction and posts it to the blockchain.
   *
   * The transaction signer is determined by the transaction content. A lookup for
   * the private key for the signer in the given wallet ID is done automatically.
   */
  public async signAndPost(transaction: UnsignedTransaction, walletId: WalletId): Promise<PostTxResponse>;
  public async signAndPost(transactions: ReadonlyArray<UnsignedTransaction>, walletId: WalletId): Promise<ReadonlyArray<Promise<PostTxResponse>>>;
  public async signAndPost(tx: UnsignedTransaction | ReadonlyArray<UnsignedTransaction>, walletId: WalletId): Promise<PostTxResponse | ReadonlyArray<Promise<PostTxResponse>>> {
    if (isUnsignedTransaction(tx)) {
      const firstResult = (await this.signAndPost([tx], walletId))[0];
      return firstResult;
    }

However, implementing this is too complicated as long as one identity can be in a profile multiple times

@ethanfrey
Copy link
Contributor

However, implementing this is too complicated as long as one identity can be in a profile multiple times

Yes, I would love to enforce uniqueness and then remove need for WalletId in many of these methods, where an identity (public key and chain) is sufficient. Did you have another issue for that one as well?

Seems like a good thing shortly post-v0.12

@webmaster128
Copy link
Contributor Author

Did you have another issue for that one as well?

Jap, but was not on the board before: #652

@webmaster128 webmaster128 removed their assignment Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants