Skip to content

Commit b6f27d6

Browse files
bitzoicIGI-111K1-R1
authored
Change msg_sender()'s Input::Message from sender to recipient (#6497)
## Description The `msg_sender()` function used the `sender` of a `Input::Message` rather than the `recipient`. Closes #6485 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: IGI-111 <igi-111@protonmail.com> Co-authored-by: K1-R1 <77465250+K1-R1@users.noreply.github.com>
1 parent 8959f11 commit b6f27d6

File tree

2 files changed

+3
-10
lines changed
  • sway-lib-std/src
  • test/src/sdk-harness/test_projects/auth

2 files changed

+3
-10
lines changed

sway-lib-std/src/auth.sw

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ use ::contract_id::ContractId;
66
use ::identity::Identity;
77
use ::option::Option::{self, *};
88
use ::result::Result::{self, *};
9-
use ::inputs::{
10-
Input,
11-
input_coin_owner,
12-
input_count,
13-
input_message_recipient,
14-
input_message_sender,
15-
input_type,
16-
};
9+
use ::inputs::{Input, input_coin_owner, input_count, input_message_recipient, input_type,};
1710
use ::revert::revert;
1811

1912
/// The error type used when an `Identity` cannot be determined.
@@ -163,7 +156,7 @@ pub fn caller_address() -> Result<Address, AuthError> {
163156
input_coin_owner(iter)
164157
},
165158
Some(Input::Message) => {
166-
input_message_sender(iter)
159+
input_message_recipient(iter)
167160
},
168161
_ => {
169162
// type != InputCoin or InputMessage, continue looping.

test/src/sdk-harness/test_projects/auth/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async fn input_message_msg_sender_from_contract() {
108108
// Start building transactions
109109
let call_handler = instance
110110
.methods()
111-
.returns_msg_sender_address(Address::from(*msg.sender.hash()));
111+
.returns_msg_sender_address(Address::from(*msg.recipient.hash()));
112112
let mut tb = call_handler.transaction_builder().await.unwrap();
113113

114114
// Inputs

0 commit comments

Comments
 (0)