# Simulate Call as ContractID from WalletUnlocked?

**URL:** <https://forum.fuel.network/t/simulate-call-as-contractid-from-walletunlocked/2536>\
**Category:** Rust SDK\
**Tags:** feedback\
**Created:** [May 4, 2023, 1:01am UTC](https://forum.fuel.network/t/simulate-call-as-contractid-from-walletunlocked/2536 "2023-05-04T01:01:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diyahir](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/diyahir/32/1075_2.png) [@diyahir](https://forum.fuel.network/u/diyahir)\
**Post date:** [May 4, 2023, 1:01am UTC](https://forum.fuel.network/t/simulate-call-as-contractid-from-walletunlocked/2536/1 "2023-05-04T01:01:58Z")

</div>

I have a contract A that is restricted to be called by another contract B which is of type ‘ContractID’.

But I want to test it quickly without spinning up both A and B, currently, I am only aware of making calls as ‘Identity::Address’.

Is there a way to pretend to be a ContractID in a rust integration test instead of just a wallet identity?

This will greatly simplify the testing process without needing to get B to the proper state to call A.

Ethereum doesn’t make a strong distinction between contracts and eoa’s wrt to testing, so I’m wondering if Fuel has plans to do this as well

---

<div class="post-metadata">

**Author:** ![sandusky](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sandusky/32/1313_2.png) [@sandusky](https://forum.fuel.network/u/sandusky)\
**Post date:** [May 5, 2023, 3:01pm UTC](https://forum.fuel.network/t/simulate-call-as-contractid-from-walletunlocked/2536/2 "2023-05-05T15:01:13Z")

</div>

Hi there!

You may take a look into this

[https://rust.fuel.network/v0.41.0/testing/the-setup-program-test-macro.html](https://rust.fuel.network/v0.41.0/testing/the-setup-program-test-macro.html)

Please let me know if it solves your question.  
⛽

---

<div class="post-metadata">

**Author:** ![diyahir](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/diyahir/32/1075_2.png) [@diyahir](https://forum.fuel.network/u/diyahir)\
**Post date:** [May 8, 2023, 12:39am UTC](https://forum.fuel.network/t/simulate-call-as-contractid-from-walletunlocked/2536/3 "2023-05-08T00:39:11Z")

</div>

> <https://github.com/FuelLabs/fuels-rs/issues/952>
>
> I have a contract A that is restricted to be called by another contract B which …is of type ‘ContractID’.
> 
> But I want to test A quickly without spinning up both A and B, currently, I am only aware of making calls as ‘Identity::Address’.
> 
> Is there a way to pretend to be a ContractID in a rust integration test instead of just a wallet identity?
> 
> This will greatly simplify the testing process without needing to get B to the proper state to call A.
> 
> Ethereum doesn’t make a strong distinction between contracts and eoa’s wrt to testing, so I’m wondering if Fuel has plans to do this as well
> 
> \`\`\`
> storage {
> adminID: Identity = Identity(...),
> adminCID: ContractId = ContractId(...),
> }
> \`\`\`
> 
> In this case it's easier to run an integration test if the admin is an identity since you can use wallet unlocked class to test it easily, but the production it should be a ContractId since it's a contract
> 
> Is the recommendation to always use Identity for easier testing? that would make using the contract's abi more complicated since you would need to cast the Identity to a ContractId 
> 
> \`\`\`
> let admin\_contract = abi(Admin, storage.adminCID.value);
> \`\`\`

I don’t believe this solves the issue, can you check this github issue for more context I could be wrong, but that suggestions is more or less what I’m doing currently
