solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
1.97k stars 791 forks source link

`setTransactionMessageFeePayerSigner` should overwrite signer when different #2897

Open steveluscher opened 4 days ago

steveluscher commented 4 days ago

Presently, setTransactionMessageFeePayerSigner() doesn't let someone change the TransactionSigner if one already exists. If I have a message where the fee payer is Bob(Address A)/Phantom and I want to change it to Bob(Address A)/Solflare, this won't:

https://github.com/solana-labs/solana-web3.js/blob/09366737ee6b8b96b2d50c6d3561db5622304b8f/packages/signers/src/fee-payer-signer.ts#L22-L23

As discussed in #2874.