Migrate all contract-related tooling and tests to accept a chain ID in domain separators.

This commit is contained in:
Lawrence Forman
2019-03-22 16:18:49 -04:00
committed by Amir Bandeali
parent 92fe720ac3
commit 2d28fde24d
39 changed files with 282 additions and 64 deletions

View File

@@ -8,9 +8,12 @@ export class TransactionFactory {
private readonly _signerBuff: Buffer;
private readonly _exchangeAddress: string;
private readonly _privateKey: Buffer;
constructor(privateKey: Buffer, exchangeAddress: string) {
private readonly _chainId: number;
constructor(privateKey: Buffer, exchangeAddress: string, chainId: number) {
this._privateKey = privateKey;
this._exchangeAddress = exchangeAddress;
this._chainId = chainId;
this._signerBuff = ethUtil.privateToAddress(this._privateKey);
}
public newSignedTransaction(
@@ -24,6 +27,7 @@ export class TransactionFactory {
signerAddress,
data,
verifyingContractAddress: this._exchangeAddress,
chainId: this._chainId,
};
const transactionHashBuffer = transactionHashUtils.getTransactionHashBuffer(transaction);