-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1064 from MoralisWeb3/feat/internal_transactions
feat: add internal transactions
- Loading branch information
Showing
18 changed files
with
457 additions
and
33 deletions.
There are no files selected for viewing
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,6 @@ | ||
--- | ||
'@moralisweb3/common-evm-utils': minor | ||
'@moralisweb3/evm-api': minor | ||
--- | ||
|
||
Add internal transactions param to several operations and `Moralis.Evm.transaction.getInternalTransactions()` |
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
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
30 changes: 30 additions & 0 deletions
30
packages/common/evmUtils/src/operations/transaction/getInternalTransactionsOperation.test.ts
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,30 @@ | ||
import MoralisCore from '@moralisweb3/common-core'; | ||
import { EvmChain } from '../../dataTypes'; | ||
import { getInternalTransactionsOperation, GetInternalTransactionsRequest } from './getInternalTransactionsOperation'; | ||
|
||
describe('getInternalTransactionsOperation', () => { | ||
let core: MoralisCore; | ||
|
||
beforeAll(() => { | ||
core = MoralisCore.create(); | ||
}); | ||
|
||
it('serializeRequest() serializes correctly and deserializeRequest() deserializes correctly', () => { | ||
const chain = '0x10'; | ||
|
||
const request: Required<GetInternalTransactionsRequest> = { | ||
chain: EvmChain.create(chain, core), | ||
transactionHash: '0x9857d679ab331210161427d36d08c3b00e6d28c03366e9b891832ad9b5d478f7z', | ||
}; | ||
|
||
const serializedRequest = getInternalTransactionsOperation.serializeRequest(request, core); | ||
|
||
expect(serializedRequest.chain).toBe(chain); | ||
expect(serializedRequest.transactionHash).toBe(request.transactionHash); | ||
|
||
const deserializedRequest = getInternalTransactionsOperation.deserializeRequest(serializedRequest, core); | ||
|
||
expect((deserializedRequest.chain as EvmChain).apiHex).toBe(chain); | ||
expect(deserializedRequest.transactionHash).toBe(request.transactionHash); | ||
}); | ||
}); |
Oops, something went wrong.