Skip to content

Commit

Permalink
Fix: Rename withdrawal_id to withdrawal-id
Browse files Browse the repository at this point in the history
  • Loading branch information
jbencin committed Apr 13, 2023
1 parent 5ec836b commit 37652e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/clarity_vm/withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ pub fn generate_key_from_event(

if let Value::Tuple(ref mut data) = event_data.value {
let data_map = &mut data.data_map;
data_map.insert("withdrawal_id".into(), Value::UInt(withdrawal_id as u128));
data_map.insert(
"withdrawal-id".into(),
Value::UInt(u128::from(withdrawal_id)),
);
let event_type = data_map.get("type")?.clone().expect_ascii();

return match event_type.as_str() {
Expand Down
4 changes: 2 additions & 2 deletions testnet/stacks-node/src/tests/l1_observer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ fn l1_deposit_and_withdraw_asset_integration_test() {
let mut withdrawal_height = 0;
for (height, event) in withdraw_events {
withdrawal_height = height;
let withdrawal_id = event.get("withdrawal_id").unwrap().clone().expect_u128() as u32;
let withdrawal_id = event.get("withdrawal-id").unwrap().clone().expect_u128() as u32;
match event.get("type").unwrap().clone().expect_ascii().as_str() {
"ft" => ft_withdrawal_id = withdrawal_id,
"nft" => nft_withdrawal_id = withdrawal_id,
Expand Down Expand Up @@ -1561,7 +1561,7 @@ fn l1_deposit_and_withdraw_stx_integration_test() {
let (withdrawal_height, withdrawal) = withdraw_events.pop().unwrap();

let withdrawal_id = withdrawal
.get("withdrawal_id")
.get("withdrawal-id")
.unwrap()
.clone()
.expect_u128() as u32;
Expand Down

0 comments on commit 37652e7

Please sign in to comment.