|
1 | 1 |
|
2 | 2 | import * as chai from 'chai'
|
3 | 3 | import { ethers } from 'ethers'
|
| 4 | +import { commons } from "@0xsequence/core" |
4 | 5 | import { isSignerStatusPending, isSignerStatusRejected, isSignerStatusSigned, Orchestrator, Status } from '../src'
|
5 | 6 | import { SapientSigner } from '../src/signers'
|
6 | 7 |
|
@@ -109,6 +110,11 @@ describe('Orchestrator', () => {
|
109 | 110 | getAddress: async function (): Promise<string> {
|
110 | 111 | return brokenSignerEOA.address
|
111 | 112 | },
|
| 113 | + decorateTransactions( |
| 114 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 115 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 116 | + throw new Error('This is a broken signer.') |
| 117 | + }, |
112 | 118 | requestSignature: async function (
|
113 | 119 | id: string,
|
114 | 120 | message: ethers.utils.BytesLike,
|
@@ -189,6 +195,11 @@ describe('Orchestrator', () => {
|
189 | 195 | getAddress: async function (): Promise<string> {
|
190 | 196 | return rejectSignerEOA.address
|
191 | 197 | },
|
| 198 | + decorateTransactions( |
| 199 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 200 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 201 | + throw new Error('This is a rejected signer.') |
| 202 | + }, |
192 | 203 | requestSignature: async function (
|
193 | 204 | id: string,
|
194 | 205 | message: ethers.utils.BytesLike,
|
@@ -241,6 +252,11 @@ describe('Orchestrator', () => {
|
241 | 252 | getAddress: async function (): Promise<string> {
|
242 | 253 | return '0x1234'
|
243 | 254 | },
|
| 255 | + decorateTransactions( |
| 256 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 257 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 258 | + return Promise.resolve(bundle) |
| 259 | + }, |
244 | 260 | requestSignature: async function (
|
245 | 261 | id: string,
|
246 | 262 | message: ethers.utils.BytesLike,
|
@@ -269,6 +285,11 @@ describe('Orchestrator', () => {
|
269 | 285 | getAddress: async function (): Promise<string> {
|
270 | 286 | return '0x1234'
|
271 | 287 | },
|
| 288 | + decorateTransactions( |
| 289 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 290 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 291 | + return Promise.resolve(bundle) |
| 292 | + }, |
272 | 293 | requestSignature: async function (
|
273 | 294 | id: string,
|
274 | 295 | message: ethers.utils.BytesLike,
|
@@ -301,6 +322,11 @@ describe('Orchestrator', () => {
|
301 | 322 | getAddress: async function (): Promise<string> {
|
302 | 323 | return '0x1234'
|
303 | 324 | },
|
| 325 | + decorateTransactions( |
| 326 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 327 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 328 | + return Promise.resolve(bundle) |
| 329 | + }, |
304 | 330 | requestSignature: async function (
|
305 | 331 | id: string,
|
306 | 332 | message: ethers.utils.BytesLike,
|
@@ -331,6 +357,11 @@ describe('Orchestrator', () => {
|
331 | 357 | getAddress: async function (): Promise<string> {
|
332 | 358 | return '0x5678'
|
333 | 359 | },
|
| 360 | + decorateTransactions( |
| 361 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 362 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 363 | + return Promise.resolve(bundle) |
| 364 | + }, |
334 | 365 | requestSignature: async function (
|
335 | 366 | id: string,
|
336 | 367 | message: ethers.utils.BytesLike,
|
@@ -383,6 +414,11 @@ describe('Orchestrator', () => {
|
383 | 414 | getAddress: async function (): Promise<string> {
|
384 | 415 | return '0x1234'
|
385 | 416 | },
|
| 417 | + decorateTransactions( |
| 418 | + bundle: commons.transaction.IntendedTransactionBundle, |
| 419 | + ): Promise<commons.transaction.IntendedTransactionBundle> { |
| 420 | + return Promise.resolve(bundle) |
| 421 | + }, |
386 | 422 | requestSignature: async function (
|
387 | 423 | id: string,
|
388 | 424 | message: ethers.utils.BytesLike,
|
|
0 commit comments