Skip to content

Commit

Permalink
Removes vp updates
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Feb 8, 2024
1 parent 4209a74 commit 9f3ed2c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
22 changes: 0 additions & 22 deletions wasm/wasm_source/src/tx_update_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,6 @@ fn apply_tx(ctx: &mut Ctx, tx: Tx) -> TxResult {
let owner = &tx_data.addr;
debug_log!("update VP for: {:#?}", tx_data.addr);

if let Some(hash) = tx_data.vp_code_hash {
let vp_code_sec = signed
.get_section(&hash)
.ok_or_err_msg("vp code section not found")
.map_err(|err| {
ctx.set_commitment_sentinel();
err
})?
.extra_data_sec()
.ok_or_err_msg("vp code section must be tagged as extra")
.map_err(|err| {
ctx.set_commitment_sentinel();
err
})?;

ctx.update_validity_predicate(
owner,
vp_code_sec.code.hash(),
&vp_code_sec.tag,
)?;
}

if let Some(threshold) = tx_data.threshold {
let threshold_key = account::threshold_key(owner);
ctx.write(&threshold_key, threshold)?;
Expand Down
9 changes: 1 addition & 8 deletions wasm/wasm_source/src/vp_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,7 @@ fn validate_tx(
KeyType::PoS => validate_pos_changes(ctx, &addr, key, &valid_sig)?,
KeyType::PgfSteward(address) => address != &addr || *valid_sig,
KeyType::GovernanceVote(voter) => voter != &addr || *valid_sig,
KeyType::Vp(owner) => {
let has_post: bool = ctx.has_key_post(key)?;
if owner == &addr {
has_post && *valid_sig
} else {
true
}
}
KeyType::Vp(owner) => !(owner == &addr),
KeyType::Masp | KeyType::Ibc => true,
KeyType::Unknown => {
// Unknown changes require a valid signature
Expand Down

0 comments on commit 9f3ed2c

Please sign in to comment.