-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add guarded tx in a batch * add guarded property in submitGateway function * update @etherspot/contracts
- Loading branch information
1 parent
639ee40
commit c126a63
Showing
11 changed files
with
115 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ContractNames } from '@etherspot/contracts'; | ||
import { mockContract } from '../../../../testing'; | ||
|
||
export const GatewayV2Contract = mockContract(ContractNames.GatewayV2, { | ||
encodeSendBatchFromAccount: jest.fn(), | ||
encodeDelegateBatch: jest.fn(), | ||
buildDelegatedBatchTypedData: jest.fn(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ContractNames } from '@etherspot/contracts'; | ||
import { TransactionRequest } from '../../common'; | ||
import { InternalContract } from './internal.contract'; | ||
|
||
export class GatewayV2Contract extends InternalContract { | ||
constructor() { | ||
super(ContractNames.GatewayV2); | ||
} | ||
|
||
encodeSendBatchFromAccount?(account: string, to: string[], data: string[]): TransactionRequest; | ||
|
||
encodeDelegateBatch?( | ||
account: string, | ||
nonce: number, | ||
to: string[], | ||
data: string[], | ||
senderSignature: string, | ||
): TransactionRequest; | ||
|
||
encodeSendBatchFromAccountGuarded?( | ||
account: string, | ||
to: string[], | ||
data: string[], | ||
): TransactionRequest; | ||
|
||
hashDelegatedBatch(account: string, nonce: number, to: string[], data: string[]): Buffer { | ||
return this.hashMessagePayload( | ||
'DelegatedBatch', | ||
[ | ||
{ name: 'account', type: 'address' }, // | ||
{ name: 'nonce', type: 'uint256' }, | ||
{ name: 'to', type: 'address[]' }, | ||
{ name: 'data', type: 'bytes[]' }, | ||
], | ||
{ | ||
account, // | ||
nonce, | ||
to, | ||
data, | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ export interface GatewayBatch { | |
data: string; | ||
}[]; | ||
estimation: GatewayEstimatedBatch; | ||
guarded?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters