Skip to content

Commit

Permalink
Erce/fix rpc error message (#397)
Browse files Browse the repository at this point in the history
* Update uniswap tests from sov repo

* Add uniswap addrs to evm genesis

* fix eth_getTransactionByHash

* Fix uniswap test scripts

* Use hardhat config for swap script. Add asserts

* Test ci

* Fix readme

* CI

* Swap tests

* CI

* Fix eteherum & ledger rpc error messages

* Remove unnecessary constants

* Lint

* Minor refactor

* Use static error message in ledger rpc

* Remove unnecessat error conversions

* Lint

* Better errors

* Rollback sov-sequencer errors

* Minor refactor

* Minor refactor

* Lint

* Return actual error from sequencer for the client

* Add node descriptive error message

* Refactor

* Specify return types for rpc.register_async_method

---------

Co-authored-by: Roman Proskuryakoff <[email protected]>
Co-authored-by: eyusufatik <[email protected]>
  • Loading branch information
3 people authored Apr 23, 2024
1 parent 74734a3 commit 47d98bb
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 127 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions bin/citrea/tests/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async fn test_same_nonce_tx_should_panic() {
// send tx with nonce 1 again and expect it to be rejected
let res = test_client.send_eth(addr, None, None, Some(1), 0u128).await;

assert!(res.unwrap_err().to_string().contains("already imported"));
assert!(res.unwrap_err().to_string().contains("already known"));

seq_task.abort();
}
Expand All @@ -87,8 +87,7 @@ async fn test_nonce_too_low() {
.unwrap();

let res = test_client.send_eth(addr, None, None, Some(0), 0u128).await;

assert!(res.unwrap_err().to_string().contains("already imported"));
assert!(res.unwrap_err().to_string().contains("already known"));

seq_task.abort();
}
Expand Down Expand Up @@ -292,15 +291,15 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

// Replacement error with equal fee
let err = test_client
.send_eth(addr, Some(100u64), Some(MAX_FEE_PER_GAS), Some(0), 0u128)
.await
.unwrap_err();

assert!(err.to_string().contains("already imported"));
assert!(err.to_string().contains("already known"));

// Replacement error with enough base fee but low priority fee
let err = test_client
Expand All @@ -316,7 +315,7 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

// Replacement error with enough base fee but low priority fee
let err = test_client
Expand All @@ -332,7 +331,7 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

// Replacement error with not enough fee increase (like 5% or sth.)
let err = test_client
Expand All @@ -348,7 +347,7 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

// Replacement success with 10% fee bump - does not work
let err = test_client
Expand All @@ -364,7 +363,7 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

let err = test_client
.send_eth(
Expand All @@ -379,7 +378,7 @@ async fn test_same_nonce_tx_replacement() {

assert!(err
.to_string()
.contains("insufficient gas price to replace existing transaction"));
.contains("replacement transaction underpriced"));

// Replacement success with more than 10% bump
let tx_hash_11_bump = test_client
Expand Down
Loading

0 comments on commit 47d98bb

Please sign in to comment.