Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit d3bfbd8

Browse files
Merge branch '4.x' into nicolasbrugneaux/getEthereumjsTxDataFromTransaction
2 parents f176bff + aa471e7 commit d3bfbd8

File tree

6 files changed

+21
-5
lines changed

6 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,7 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
27242724

27252725
#### web3
27262726

2727-
- Return type for the static `Web3.requestEIP6963Providers` function is now `Promise<EIP6963ProviderResponse>`. (#7239)
2727+
- `Web3.providers` namespace exports `type EIP6963ProviderResponse = Map<string, EIP6963ProviderDetail>`. Return type for the static `Web3.requestEIP6963Providers` function is now `Promise<EIP6963ProviderResponse>`. (#7239)
27282728
- The callback function provided to the static `Web3.onNewProviderDiscovered` function expects a parameter of type `EIP6963ProvidersMapUpdateEvent` as opposed to `EIP6963AnnounceProviderEvent`. (#7242)
27292729

27302730
## [Unreleased]

docs/docs/guides/hardhat_tutorial/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Following the recent compatibility update of Hardhat plugin [hardhat-web3-v4](ht
1010

1111
This tutorial will guide you through using Web3js as a plugin to interact with the Blockchain.
1212

13+
:::info
14+
This tutorial explains how to create a Web3.js + Hardhat project from scratch. The [`create-hardhat-web3`](https://github.com/web3/hardhat-web3) command line utility was created to automate many of the steps in this tutorial and make it easier to quickly bootstrap a new Web3.js + Hardhat project.
15+
:::
16+
1317
## Pre-requisite
1418
This tutorial assumes you have previous knowledge of writing Smart contracts, and are convenient working with JavaScript/TypeScript. You should have [NodeJS](https://nodejs.org/en) version greater than v16 installed.
1519

packages/web3-utils/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,7 @@ Documentation:
235235
- `_sendPendingRequests` will catch unhandled errors from `_sendToSocket` (#6968)
236236

237237
## [Unreleased]
238+
239+
### Fixed
240+
241+
- fix `padRight` validation failure on large `uint` (#7265)

packages/web3-utils/src/string_manipulation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export const padRight = (value: Numbers, characterAmount: number, sign = '0'): s
7575
return value.padEnd(characterAmount, sign);
7676
}
7777

78-
validator.validate(['int'], [value]);
79-
8078
const hexString = typeof value === 'string' && isHexStrict(value) ? value : numberToHex(value);
81-
8279
const prefixLength = hexString.startsWith('-') ? 3 : 2;
80+
81+
validator.validate([hexString.startsWith('-') ? 'int' : 'uint'], [value]);
82+
8383
return hexString.padEnd(characterAmount + prefixLength, sign);
8484
};
8585

packages/web3-utils/test/fixtures/string_manipulation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ export const padRightData: [[Numbers, number, string], HexString][] = [
5656
[[BigInt(10000), 8, '0'], '0x27100000'],
5757
[[BigInt(-14), 8, '0'], '-0xe0000000'],
5858
[['15.5', 8, '0'], '15.50000'],
59+
[
60+
['0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64, '0'],
61+
'0x05e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2',
62+
],
63+
[
64+
['0xb5e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2', 64, '0'],
65+
'0xb5e2e7de3cd95eb48fa9ff77e7860cf249fe05f726abea45a0a44e62b4bf52b2',
66+
],
5967
];
6068

6169
export const toTwosComplementData: [[Numbers, number | undefined], HexString][] = [

packages/web3/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ Documentation:
486486

487487
### Changed
488488

489-
- Return type for the static `Web3.requestEIP6963Providers` function is now `Promise<EIP6963ProviderResponse>`. (#7239)
489+
- `Web3.providers` namespace exports `type EIP6963ProviderResponse = Map<string, EIP6963ProviderDetail>`. Return type for the static `Web3.requestEIP6963Providers` function is now `Promise<EIP6963ProviderResponse>`. (#7239)
490490
- The callback function provided to the static `Web3.onNewProviderDiscovered` function expects a parameter of type `EIP6963ProvidersMapUpdateEvent` as opposed to `EIP6963AnnounceProviderEvent`. (#7242)
491491

492492
## [Unreleased]

0 commit comments

Comments
 (0)