refactor: add message for next receive address

The Next message will be used for getting the next page
of unused addresses.
This commit is contained in:
Michael Mallan 2025-05-07 11:29:53 +01:00
parent 8b8b48142f
commit daa3daa938
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB
3 changed files with 8 additions and 3 deletions

View File

@ -156,7 +156,7 @@ impl State for ReceivePanel {
));
Task::none()
}
Message::View(view::Message::Next) => {
Message::View(view::Message::NextReceiveAddress) => {
let daemon = daemon.clone();
Task::perform(
async move {
@ -364,7 +364,11 @@ mod tests {
let cache = Cache::default();
let sandbox = sandbox.load(client.clone(), &cache, wallet).await;
let sandbox = sandbox
.update(client, &cache, Message::View(viewMessage::Next))
.update(
client,
&cache,
Message::View(viewMessage::NextReceiveAddress),
)
.await;
let panel = sandbox.state();

View File

@ -14,6 +14,7 @@ pub enum Message {
Select(usize),
SelectPayment(OutPoint),
Label(Vec<String>, LabelMessage),
NextReceiveAddress,
Settings(SettingsMessage),
CreateSpend(CreateSpendMessage),
ImportSpend(ImportSpendMessage),

View File

@ -45,7 +45,7 @@ pub fn receive<'a>(
.push(Container::new(h3("Receive")).width(Length::Fill))
.push(
button::primary(Some(icon::plus_icon()), "Generate address")
.on_press(Message::Next),
.on_press(Message::NextReceiveAddress),
),
)
.push(p1_bold("New and never used reception addresses"))