Skip to content

Commit

Permalink
fix implicit storage score
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Nov 8, 2023
1 parent 81e49d7 commit c844407
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/src/types/block/address/implicit_account_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl ImplicitAccountCreationAddress {

impl StorageScore for ImplicitAccountCreationAddress {
fn storage_score(&self, params: StorageScoreParameters) -> u64 {
params.implicit_account_creation_address_offset() + self.0.storage_score(params)
params.implicit_account_creation_address_offset()
}
}

Expand Down
4 changes: 1 addition & 3 deletions sdk/src/types/block/output/storage_score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ impl StorageScoreParameters {
.finish()
.unwrap()
.storage_score(*self);
let ed25519_address_score = null_address.storage_score(*self);
let basic_score_without_address = basic_output_score - ed25519_address_score;
let account_output_score = AccountOutputBuilder::new_with_amount(0, AccountId::null())
.add_unlock_condition(AddressUnlockCondition::new(null_address))
.add_feature(BlockIssuerFeature::new(0, [BlockIssuerKey::Ed25519(Ed25519BlockIssuerKey::null())]).unwrap())
.finish()
.unwrap()
.storage_score(*self);
account_output_score - basic_score_without_address
account_output_score - basic_output_score + null_address.storage_score(*self)
}
}

Expand Down

0 comments on commit c844407

Please sign in to comment.