Add final req creation

This commit is contained in:
Bogdan-Ștefan Neacşu
2024-07-04 13:54:13 +00:00
parent 02b194bde0
commit a06e496f78
@@ -41,6 +41,23 @@ impl AuthenticatorRequest {
request_id,
)
}
pub fn new_final_request(gateway_client: GatewayClient, reply_to: Recipient) -> (Self, u64) {
let request_id = generate_random();
(
Self {
version: VERSION,
data: AuthenticatorRequestData::Final(gateway_client),
reply_to,
},
request_id,
)
}
pub fn to_bytes(&self) -> Result<Vec<u8>, bincode::Error> {
use bincode::Options;
make_bincode_serializer().serialize(self)
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]