Skip to content

Commit

Permalink
Account for change in client factory method return type
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Mar 6, 2024
1 parent 9ae8669 commit c45fda4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AwsEncryptionSDK/dafny/AwsEncryptionSdk/src/Index.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module
}

method ESDK(config: AwsEncryptionSdkConfig)
returns (res: Result<ESDKClient, Error>)
returns (res: Result<IAwsEncryptionSdkClient, Error>)
{
var maybeCrypto := Primitives.AtomicPrimitives();
var crypto :- maybeCrypto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ module TestCreateEsdkClient {
method {:test} TestClientCreation() {
var defaultConfig := EncryptionSdk.DefaultAwsEncryptionSdkConfig();

var esdk :- expect EncryptionSdk.ESDK(config := defaultConfig);

expect esdk.config.commitmentPolicy == defaultConfig.commitmentPolicy.value;
expect esdk.config.maxEncryptedDataKeys == defaultConfig.maxEncryptedDataKeys;
expect esdk.config.netV4_0_0_RetryPolicy == Types.NetV4_0_0_RetryPolicy.ALLOW_RETRY;
var esdk: Types.IAwsEncryptionSdkClient :- expect EncryptionSdk.ESDK(config := defaultConfig);
expect esdk is EncryptionSdk.ESDKClient;
var esdkClient := esdk as EncryptionSdk.ESDKClient;

expect esdkClient.config.commitmentPolicy == defaultConfig.commitmentPolicy.value;
expect esdkClient.config.maxEncryptedDataKeys == defaultConfig.maxEncryptedDataKeys;
expect esdkClient.config.netV4_0_0_RetryPolicy == Types.NetV4_0_0_RetryPolicy.ALLOW_RETRY;
}

method {:test} TestNetRetryFlag() {
Expand Down

0 comments on commit c45fda4

Please sign in to comment.