Skip to content

Commit

Permalink
Temporarily remove the Option and Result implementations (FuelLabs#63)
Browse files Browse the repository at this point in the history
* fix:temp removal of result & option implementations

* fix:remove option & result from lib.sw

* fix:remove import of Result & change return type of msg_sender temporarily
  • Loading branch information
nfurfaro authored Mar 2, 2022
1 parent eead9c9 commit de8ee7c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 99 deletions.
12 changes: 6 additions & 6 deletions src/chain/auth.sw
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
library auth;
//! Functionality for determining who is calling an ABI method

use ::result::Result;
use ::address::Address;
use ::contract_id::ContractId;

Expand All @@ -24,18 +23,19 @@ pub fn caller_is_external() -> bool {
}

/// Get the `Sender` (ie: `Address`| ContractId) from which a call was made.
/// Returns a Result::Ok(Sender) or Result::Error.
// NOTE: Currently only returns Result::Ok variant if the parent context is Internal.
pub fn msg_sender() -> Result<Sender, AuthError> {
/// TODO: Return a Result::Ok(Sender) or Result::Error.
pub fn msg_sender() -> b256 {
if caller_is_external() {
// TODO: Add call to get_coins_owner() here when implemented,
Result::Err(AuthError::ContextError)
// Result::Err(AuthError::ContextError)
0x0000000000000000000000000000000000000000000000000000000000000000
} else {
// Get caller's contract ID
let id = ~ContractId::from(asm(r1) {
gm r1 i2;
r1: b256
});
Result::Ok(Sender::Id(id))
// Result::Ok(Sender::Id(id))
id.value
}
}
2 changes: 0 additions & 2 deletions src/lib.sw
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
library std;

dep result;
dep hash;
dep storage;
dep constants;
Expand All @@ -9,7 +8,6 @@ dep address;
dep contract_id;
dep chain;
dep context;
dep option;
dep math;
dep block;
dep token;
Expand Down
45 changes: 0 additions & 45 deletions src/option.sw

This file was deleted.

46 changes: 0 additions & 46 deletions src/result.sw

This file was deleted.

0 comments on commit de8ee7c

Please sign in to comment.