Closed lostman closed 9 months ago
Work in progress PR to deal with #1518 issue.
An example indexer to see the problem in isolation.
type Block @entity { id: ID! height: U64! hash: Bytes32! @unique memo: String! }
extern crate alloc; use fuel_indexer_utils::prelude::*; #[indexer(manifest = "find_after_save.manifest.yaml")] pub mod find_after_save_index_mod { fn find_after_save_handler(block_data: BlockData) { if block_data.header.height == 1 { info!("Processing Block#{}. (>'.')>", block_data.header.height); let mut block = Block::new( block_data.header.height.into(), block_data.id, "one".to_string(), ); block.save(); info!("Saved: {block:#?}"); let b = Block::find(Block::height().eq(block.height)).unwrap(); info!("Found: {b:#?}"); block.memo = "two".to_string(); block.save(); let b = Block::find(Block::height().eq(block.height)).unwrap(); info!("Found (expecting modified): {b:#?}"); assert_eq!(&b.memo, "two"); } } }
Please provide the exact testing steps for the reviewer(s) if this PR requires testing.
Please add neat Changelog info here, according to our Contributor's Guide.
Description
Work in progress PR to deal with #1518 issue.
An example indexer to see the problem in isolation.
Testing steps
Please provide the exact testing steps for the reviewer(s) if this PR requires testing.
Changelog
Please add neat Changelog info here, according to our Contributor's Guide.