Preserve explicit chainId in JsonRpcProvider during transaction serialization (#2691).

This commit is contained in:
Richard Moore 2022-02-22 03:53:34 -05:00
parent 5f26fd55c9
commit 6807a76b8d

@ -640,8 +640,8 @@ export class JsonRpcProvider extends BaseProvider {
const result: { [key: string]: string | AccessList } = {};
// Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros.
["gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach(function(key) {
// JSON-RPC now requires numeric values to be "quantity" values
["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach(function(key) {
if ((<any>transaction)[key] == null) { return; }
const value = hexValue((<any>transaction)[key]);
if (key === "gasLimit") { key = "gas"; }