Skip to content

Commit 24fadbe

Browse files
authored
[EffectsV2 1/n] Simplify inner temp store (#13633)
## Description This PR simplifies the fields of InnerTemporaryStore such that it's no longer dependent on the implementation details of effects. Specifically, it gets rid of all the use of WriteKind and DeleteKind stuff. Instead it only has a map of all written objects. To access to deleted objects, we could always refer to effects because we always have effects when we have the inner. ## Test Plan CI --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
1 parent c185a9d commit 24fadbe

File tree

1 file changed

+8
-11
lines changed
  • crates/sui-genesis-builder/src

1 file changed

+8
-11
lines changed

crates/sui-genesis-builder/src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use sui_types::crypto::{
2727
AuthorityKeyPair, AuthorityPublicKeyBytes, AuthoritySignInfo, AuthoritySignInfoTrait,
2828
AuthoritySignature, DefaultHash, SuiAuthoritySignature,
2929
};
30-
use sui_types::effects::{TransactionEffects, TransactionEvents};
30+
use sui_types::effects::{TransactionEffects, TransactionEffectsAPI, TransactionEvents};
3131
use sui_types::epoch_data::EpochData;
3232
use sui_types::gas::SuiGasStatus;
3333
use sui_types::gas_coin::GasCoin;
@@ -846,18 +846,15 @@ fn create_genesis_transaction(
846846
signer,
847847
genesis_digest,
848848
);
849-
assert!(inner_temp_store.objects.is_empty());
849+
assert!(inner_temp_store.input_objects.is_empty());
850850
assert!(inner_temp_store.mutable_inputs.is_empty());
851-
assert!(inner_temp_store.deleted.is_empty());
851+
assert!(effects.mutated().is_empty());
852+
assert!(effects.unwrapped().is_empty());
853+
assert!(effects.deleted().is_empty());
854+
assert!(effects.wrapped().is_empty());
855+
assert!(effects.unwrapped_then_deleted().is_empty());
852856

853-
let objects = inner_temp_store
854-
.written
855-
.into_iter()
856-
.map(|(_, (_, o, kind))| {
857-
assert_eq!(kind, sui_types::storage::WriteKind::Create);
858-
o
859-
})
860-
.collect();
857+
let objects = inner_temp_store.written.into_values().collect();
861858
(effects, inner_temp_store.events, objects)
862859
};
863860

0 commit comments

Comments
 (0)