mirror of
https://github.com/embarklabs/web3.js.git
synced 2026-08-31 14:41:17 +00:00
MethodFactory and TransactionSigner updated with ChainIdMethod in the eth module
This commit is contained in:
@@ -52,7 +52,8 @@ import {
|
||||
GetWorkMethod,
|
||||
GetPastLogsMethod,
|
||||
RequestAccountsMethod,
|
||||
VersionMethod
|
||||
VersionMethod,
|
||||
ChainIdMethod
|
||||
} from 'web3-core-method';
|
||||
|
||||
export default class MethodFactory extends AbstractMethodFactory {
|
||||
@@ -97,7 +98,8 @@ export default class MethodFactory extends AbstractMethodFactory {
|
||||
getWork: GetWorkMethod,
|
||||
getPastLogs: GetPastLogsMethod,
|
||||
requestAccounts: RequestAccountsMethod,
|
||||
getId: VersionMethod
|
||||
getId: VersionMethod,
|
||||
getChainId: ChainIdMethod
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default class TransactionSigner {
|
||||
const privateKey = this.accounts.wallet[from];
|
||||
|
||||
if (this.isUndefinedOrNull(tx.chainId)) {
|
||||
tx.chainId = await moduleInstance.getId();
|
||||
tx.chainId = await moduleInstance.getChainId();
|
||||
}
|
||||
if (this.isUndefinedOrNull(tx.nonce)) {
|
||||
tx.nonce = await moduleInstance.getTransactionCount(tx.from);
|
||||
|
||||
Reference in New Issue
Block a user