Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: RPC provider API key modifications (#269)
Follow-up testing and bugfixes for #252. This PR... * Adds state machine tests for the following scenarios: * Set the key for a provider that uses `RpcAuth::BearerToken`. * Update a previously existing API key of some provider to `None` removes it. * Panic if trying to specify an API key for a provider that uses `RpcAccess::Unauthenticated` * Panic if a provider is not found. * Sets up the following canister upgrade tests: * Keep previously inserted API keys. * Change or keep demo status based on upgrade args. * Change or keep principals allowed to manage API key providers based on upgrade args. * Includes unit tests for `BoolStorable` and `PrincipalStorable`. * Removes unused `StringStorable`. * Changes the `requestCost` canister method to return `0` when in demo mode. * Fixes the following bugs: * `BoolStorable` had an inverted condition in `from_bytes` * `getProviderCost()` returned `Nat` instead of `Result<Nat, RpcError>` in the state machine test logic Note that the canister upgrade tests use the same Wasm before and after upgrade. In the future (probably out of scope of this PR), we could extend this to test upgrading from the most recently deployed canister's Wasm file.
- Loading branch information