Hello!
I am currently seeing a unit testing auth failure when calling mock_all_auths_allowing_non_root_auth
I found this while upgrading Blend to https://github.com/stellar/rs-soroban-sdk/commit/18b8fa1a358aa84afd196e2f6d44942798c8f335 to take advantage of some updates pushed to the SDK around instance storage.
I am getting non-root auth failures even after allowing them on the test env while attempting to invoke transfer with auth-next.
Failure:
1: [Diagnostic Event] contract:60cbc66b12df4bf04b9e5f7cf9051b806deaad52bc9d623673313893039b2a6f, topics:[error, Error(Auth, InvalidAction)], data:["contract call failed", transfer, [Address(Contract(c132544e1bd49d95cba076edcfd9bb175dd55ab21a881d9b7f7bf497cffa8ed8)), Address(Contract(60cbc66b12df4bf04b9e5f7cf9051b806deaad52bc9d623673313893039b2a6f)), 150000000]]
2: [Failed Diagnostic Event (not emitted)] contract:1e276ddd0b7568275cc561c86704f18f77e3238dc2443b7afff3bc2db63fad06, topics:[log], data:["VM call trapped with HostError", transfer, Error(Auth, InvalidAction)]
3: [Failed Diagnostic Event (not emitted)] contract:1e276ddd0b7568275cc561c86704f18f77e3238dc2443b7afff3bc2db63fad06, topics:[error, Error(Auth, InvalidAction)], data:"escalating error to VM trap from failed host function call: require_auth"
4: [Failed Diagnostic Event (not emitted)] contract:1e276ddd0b7568275cc561c86704f18f77e3238dc2443b7afff3bc2db63fad06, topics:[error, Error(Auth, InvalidAction)], data:["[recording authorization only] encountered authorization not tied to the root contract invocation for an address. Use `require_auth()` in the top invocation or enable non-root authorization.", Address(Contract(c132544e1bd49d95cba076edcfd9bb175dd55ab21a881d9b7f7bf497cffa8ed8))]
Unit Tests:
https://github.com/blend-capital/blend-contracts/blob/sdk-update/lending-pool/src/pool/submit.rs#L69
Hoping to get some direction on where to begin debugging. Note - these functions are exercised via integration tests by calling the contract clients and there doesn't seem to be an issue. Looks like the as_contract frame might have something to do with it.