MethodFactory and TransactionSigner updated with ChainIdMethod in the eth module

This commit is contained in:
Samuel Furter
2019-02-18 17:48:13 +01:00
parent fcc3d6c315
commit d98cef2050
2 changed files with 5 additions and 3 deletions
@@ -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);