Skip to content

Commit cc2c9d1

Browse files
authored
datacap: test invoking allowance (#800)
1 parent 319e43e commit cc2c9d1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test_vm/tests/datacap_tests.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use test_vm::util::{apply_code, apply_ok, create_accounts, create_miner};
1515
use test_vm::VM;
1616

1717
use fil_actor_datacap::{Method as DataCapMethod, MintParams};
18-
use frc46_token::token::types::TransferFromParams;
18+
use frc46_token::token::types::{GetAllowanceParams, TransferFromParams};
1919
use fvm_ipld_encoding::RawBytes;
2020

2121
/* Mint a token for client and transfer it to a receiver, exercising error cases */
@@ -63,6 +63,17 @@ fn datacap_transfer_scenario() {
6363
mint_params,
6464
);
6565

66+
// confirm allowance was set to infinity
67+
apply_ok(
68+
&v,
69+
// anyone can call Allowance
70+
owner,
71+
DATACAP_TOKEN_ACTOR_ADDR,
72+
TokenAmount::zero(),
73+
DataCapMethod::Allowance as u64,
74+
GetAllowanceParams { owner: client, operator },
75+
);
76+
6677
let alloc = AllocationRequest {
6778
provider: maddr,
6879
data: make_piece_cid("datacap-test-alloc".as_bytes()),

0 commit comments

Comments
 (0)