Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 6 additions & 36 deletions crates/iota-e2e-tests/tests/full_node_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,32 +271,7 @@ async fn test_full_node_indexes() -> Result<(), anyhow::Error> {
let node = &test_cluster.fullnode_handle.iota_node;
let context = &mut test_cluster.wallet;

let (transferred_object, sender, receiver, digest, _) = transfer_coin(context).await?;

let txes = node
.state()
.get_transactions_for_tests(
Some(TransactionFilter::InputObject(transferred_object)),
None,
None,
false,
)
.await?;

assert_eq!(txes.len(), 1);
assert_eq!(txes[0], digest);

let txes = node
.state()
.get_transactions_for_tests(
Some(TransactionFilter::ChangedObject(transferred_object)),
None,
None,
false,
)
.await?;
assert_eq!(txes.len(), 2);
assert_eq!(txes[1], digest);
Comment on lines -274 to -299
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it needed to remove these checks?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Database tables that were used to perform those filters were deprecated and removed in the cleanups mentioned in the description, so it's impossible to perform those checks any longer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a reply, for context:
two deprecated tables were removed from the IndexStore (here). This makes the use of the two filters TransactionFilter::InputObject and TransactionFilter::ChangedObject unsupported. This was indeed the error thrown by this test when run.

Some(TransactionFilter::MoveFunction {
package,
module,
function,
}) => Ok(self.get_transactions_by_move_function(
package, module, function, cursor, limit, reverse,
)?),
Some(TransactionFilter::FromAddress(address)) => {
Ok(self.get_transactions_from_addr(address, cursor, limit, reverse)?)
}
Some(TransactionFilter::ToAddress(address)) => {
Ok(self.get_transactions_to_addr(address, cursor, limit, reverse)?)
}
// NOTE: filter via checkpoint sequence number is implemented in
// `get_transactions` of authority.rs.
Some(_) => Err(IotaError::UserInput {
error: UserInputError::Unsupported(format!("{:?}", filter)),
}),

let (_, sender, receiver, digest, _) = transfer_coin(context).await?;

let txes = node
.state()
Expand Down Expand Up @@ -641,28 +616,23 @@ async fn test_full_node_event_read_api_ok() {
let node = &test_cluster.fullnode_handle.iota_node;
let jsonrpc_client = &test_cluster.fullnode_handle.rpc_client;

let (package_id, gas_id_1, _) = publish_nfts_package(context).await;
let (package_id, _, _) = publish_nfts_package(context).await;

let (transferred_object, _, _, digest, _) = transfer_coin(context).await.unwrap();
let (_, sender, _, digest, _) = transfer_coin(context).await.unwrap();

let txes = node
.state()
.get_transactions_for_tests(
Some(TransactionFilter::InputObject(transferred_object)),
Some(TransactionFilter::FromAddress(sender)),
None,
None,
false,
)
.await
.unwrap();

if gas_id_1 == transferred_object {
assert_eq!(txes.len(), 2);
assert!(txes[0] == digest || txes[1] == digest);
} else {
assert_eq!(txes.len(), 1);
assert_eq!(txes[0], digest);
}
assert_eq!(txes.len(), 2);
assert!(txes[0] == digest || txes[1] == digest);

// This is a poor substitute for the post processing taking some time
sleep(Duration::from_millis(1000)).await;
Expand Down
Loading