Skip to content

Commit

Permalink
Revert displaying status while sending back data
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Oct 30, 2024
1 parent a65ac6f commit 6e29c6d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions starknet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, false, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
display::show_status(false, false, ctx);
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
}
}
}
Expand Down Expand Up @@ -285,12 +285,12 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
display::show_status(false, true, ctx);
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
}
},
None => {
Expand All @@ -309,15 +309,15 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
display::show_status(false, true, ctx);
send_data(
comm,
Err(io::StatusWords::UserCancelled.into()),
);
display::show_status(false, true, ctx);
}
}
}
Expand Down Expand Up @@ -386,12 +386,12 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
display::show_status(false, true, ctx);
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
}
},
None => {
Expand All @@ -410,15 +410,15 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
display::show_status(false, true, ctx);
send_data(
comm,
Err(io::StatusWords::UserCancelled.into()),
);
display::show_status(false, true, ctx);
}
}
}
Expand Down Expand Up @@ -493,12 +493,12 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
display::show_status(false, true, ctx);
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
}
},
None => {
Expand Down Expand Up @@ -570,12 +570,12 @@ fn handle_apdu(comm: &mut io::Comm, ins: &Ins, ctx: &mut Ctx) {
rdata.extend_from_slice(ctx.hash.r.as_ref());
rdata.extend_from_slice(ctx.hash.s.as_ref());
rdata.extend_from_slice([ctx.hash.v].as_slice());
send_data(comm, Ok(Some(rdata)));
display::show_status(true, true, ctx);
send_data(comm, Ok(Some(rdata)));
}
false => {
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
display::show_status(false, true, ctx);
send_data(comm, Err(io::StatusWords::UserCancelled.into()));
}
},
None => {
Expand Down

0 comments on commit 6e29c6d

Please sign in to comment.