Skip to content

Commit

Permalink
Adapt SafeOperation response object types to latest API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmjssz committed May 15, 2024
1 parent 05054d3 commit cd124d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
12 changes: 8 additions & 4 deletions packages/api-kit/src/types/safeTransactionServiceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,10 @@ export type SafeOperationConfirmation = {
readonly signatureType: string
}

export type SafeOperationResponse = {
readonly created: string
readonly modified: string
export type UserOperationResponse = {
readonly ethereumTxHash: string
readonly sender: string
readonly userOperationHash: string
readonly safeOperationHash: string
readonly nonce: number
readonly initCode: null | string
readonly callData: null | string
Expand All @@ -316,11 +313,18 @@ export type SafeOperationResponse = {
readonly paymasterData: null | string
readonly signature: string
readonly entryPoint: string
}

export type SafeOperationResponse = {
readonly created: string
readonly modified: string
readonly safeOperationHash: string
readonly validAfter: string
readonly validUntil: string
readonly moduleAddress: string
readonly confirmations?: Array<SafeOperationConfirmation>
readonly preparedSignature?: string
readonly userOperation?: UserOperationResponse
}

export type GetSafeOperationListProps = {
Expand Down
32 changes: 17 additions & 15 deletions packages/api-kit/tests/e2e/getSafeOperationsByAddress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,29 @@ describe('getSafeOperationsByAddress', () => {
safeOperations.results.every((safeOperation) => {
chai.expect(safeOperation).to.have.property('created')
chai.expect(safeOperation).to.have.property('modified')
chai.expect(safeOperation).to.have.property('ethereumTxHash')
chai.expect(safeOperation).to.have.property('sender').to.eq(SAFE_ADDRESS)
chai.expect(safeOperation).to.have.property('userOperationHash')
chai.expect(safeOperation).to.have.property('safeOperationHash')
chai.expect(safeOperation).to.have.property('nonce')
chai.expect(safeOperation).to.have.property('initCode')
chai.expect(safeOperation).to.have.property('callData')
chai.expect(safeOperation).to.have.property('callDataGasLimit')
chai.expect(safeOperation).to.have.property('verificationGasLimit')
chai.expect(safeOperation).to.have.property('preVerificationGas')
chai.expect(safeOperation).to.have.property('maxFeePerGas')
chai.expect(safeOperation).to.have.property('maxPriorityFeePerGas')
chai.expect(safeOperation).to.have.property('paymaster')
chai.expect(safeOperation).to.have.property('paymasterData')
chai.expect(safeOperation).to.have.property('signature')
chai.expect(safeOperation).to.have.property('entryPoint')
chai.expect(safeOperation).to.have.property('validAfter')
chai.expect(safeOperation).to.have.property('validUntil')
chai.expect(safeOperation).to.have.property('moduleAddress')
chai.expect(safeOperation).to.have.property('confirmations').to.be.an('array')
chai.expect(safeOperation).to.have.property('preparedSignature')
chai.expect(safeOperation).to.have.property('userOperation')

chai.expect(safeOperation.userOperation).to.have.property('ethereumTxHash')
chai.expect(safeOperation.userOperation).to.have.property('sender').to.eq(SAFE_ADDRESS)
chai.expect(safeOperation.userOperation).to.have.property('userOperationHash')
chai.expect(safeOperation.userOperation).to.have.property('nonce')
chai.expect(safeOperation.userOperation).to.have.property('initCode')
chai.expect(safeOperation.userOperation).to.have.property('callData')
chai.expect(safeOperation.userOperation).to.have.property('callDataGasLimit')
chai.expect(safeOperation.userOperation).to.have.property('verificationGasLimit')
chai.expect(safeOperation.userOperation).to.have.property('preVerificationGas')
chai.expect(safeOperation.userOperation).to.have.property('maxFeePerGas')
chai.expect(safeOperation.userOperation).to.have.property('maxPriorityFeePerGas')
chai.expect(safeOperation.userOperation).to.have.property('paymaster')
chai.expect(safeOperation.userOperation).to.have.property('paymasterData')
chai.expect(safeOperation.userOperation).to.have.property('signature')
chai.expect(safeOperation.userOperation).to.have.property('entryPoint')
})
})
})

0 comments on commit cd124d8

Please sign in to comment.