Skip to content

Commit

Permalink
ignore failing mint/transfer tests
Browse files Browse the repository at this point in the history
They're expecting the old behaviour of reverting state (instead of aborting) when a mint or transfer (or receiver hook) fails. Once there's a new method of calling the receiver hook (through a type returned by mint or transfer calls) they can either be adapted to that or rewritten as integration tests
  • Loading branch information
abright committed Aug 25, 2022
1 parent 3e1b933 commit e845f57
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions fil_fungible_token/src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ mod test {
}

#[test]
#[ignore]
fn it_mints() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down Expand Up @@ -995,22 +996,27 @@ mod test {
}

#[test]
#[ignore]
fn it_fails_to_mint_if_receiver_hook_aborts() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
let mut token = new_token(bs, &mut token_state);

// force hook to abort
token.msg.abort_next_send();
let err = token
let params = token
.mint(
TOKEN_ACTOR,
TREASURY,
&TokenAmount::from(1_000_000),
RawBytes::default(),
RawBytes::default(),
)
.unwrap_err();
.unwrap();
// TODO: receiver hook call
//token.flush().unwrap();
let err = token.call_receiver_hook(TOKEN_ACTOR, params).unwrap_err();


// check error shape
match err {
Expand Down Expand Up @@ -1098,6 +1104,7 @@ mod test {
}

#[test]
#[ignore]
fn it_transfers() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down Expand Up @@ -1173,6 +1180,7 @@ mod test {
}

#[test]
#[ignore]
fn it_transfers_to_self() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down Expand Up @@ -1241,6 +1249,7 @@ mod test {
}

#[test]
#[ignore]
fn it_transfers_to_uninitialized_addresses() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down Expand Up @@ -1362,6 +1371,7 @@ mod test {
}

#[test]
#[ignore]
fn it_fails_to_transfer_when_receiver_hook_aborts() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down Expand Up @@ -1519,6 +1529,7 @@ mod test {
}

#[test]
#[ignore]
fn it_allows_delegated_transfer() {
let bs = MemoryBlockstore::new();
let mut token_state = Token::<_, FakeMessenger>::create_state(&bs).unwrap();
Expand Down

0 comments on commit e845f57

Please sign in to comment.