-
Notifications
You must be signed in to change notification settings - Fork 48
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 #817 from BoltzExchange/rsk-fixes
RSK fixes
- Loading branch information
Showing
13 changed files
with
117 additions
and
82 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
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
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
37 changes: 37 additions & 0 deletions
37
test/integration/db/repositories/PendingEthereumTransactionRepository.spec.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,37 @@ | ||
import Logger from '../../../../lib/Logger'; | ||
import Database from '../../../../lib/db/Database'; | ||
import PendingEthereumTransaction from '../../../../lib/db/models/PendingEthereumTransaction'; | ||
import PendingEthereumTransactionRepository from '../../../../lib/db/repositories/PendingEthereumTransactionRepository'; | ||
|
||
describe('PendingEthereumTransactionRepository', () => { | ||
let database: Database; | ||
|
||
beforeAll(async () => { | ||
database = new Database(Logger.disabledLogger, Database.memoryDatabase); | ||
await database.init(); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await PendingEthereumTransaction.truncate(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await database.close(); | ||
}); | ||
|
||
describe('getHighestNonce', () => { | ||
test('should get highest nonce when there are no pending transactions', async () => { | ||
await expect( | ||
PendingEthereumTransactionRepository.getHighestNonce(), | ||
).resolves.toEqual(undefined); | ||
}); | ||
|
||
test('should get highest nonce when there are pending transactions', async () => { | ||
await PendingEthereumTransactionRepository.addTransaction('txHash', 20); | ||
|
||
await expect( | ||
PendingEthereumTransactionRepository.getHighestNonce(), | ||
).resolves.toEqual(21); | ||
}); | ||
}); | ||
}); |
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