Skip to content

Commit

Permalink
update CHAGELOG.md and add code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba authored Jan 3, 2024
1 parent e6076e6 commit 97cc1b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/web3-eth-accounts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ Documentation:

- Fixed `recover` function, `v` will be normalized to value 0,1 (#6344)

## [Unreleased]
## [Unreleased]

### Fixed

- Send Transaction config used to be ignored if the passed `common` did not have a `copy()` and the `chainId` was not provided (#6663)
5 changes: 5 additions & 0 deletions packages/web3-eth-accounts/src/tx/baseTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ export abstract class BaseTransaction<TransactionObject> {
* @param chainId - Chain ID from tx options (typed txs) or signature (legacy tx)
*/
protected _getCommon(common?: Common, chainId?: Numbers) {
// TODO: this function needs to be reviewed and the code to be more clean
// check issue https://github.com/web3/web3.js/issues/6666
// Chain ID provided
if (chainId !== undefined) {
const chainIdBigInt = uint8ArrayToBigInt(toUint8Array(chainId));
Expand Down Expand Up @@ -425,6 +427,9 @@ export abstract class BaseTransaction<TransactionObject> {
if (common?.copy && typeof common?.copy === 'function') {
return common.copy();
}
// TODO: Recheck this next block when working on https://github.com/web3/web3.js/issues/6666
// This block is to handle when `chainId` was not passed and the `common` object does not have `copy()`
// If it was meant to be unsupported to process `common` in this case, an exception should be thrown instead of the following block
if (common) {
const hardfork =
typeof common.hardfork === 'function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

import {
// Common,
EthExecutionAPI,
HexString,
Web3NetAPI,
Expand Down

0 comments on commit 97cc1b5

Please sign in to comment.