-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types/basetypes: Fixed Float64Type validation to handle valid, string…
…ified numbers from Terraform (#614) Reference: #613 Numbers in Terraform's type system can be represented with up to 512 bits of base 10 precision. When encoding and decoding across the protocol, the type system or MessagePack may switch the representation to be stringified, which is valid and expected. The prior `Float64Type` type `Validate` method logic was only checking the `big.Accuracy` return from the value, however in certain cases the stringified number was saved with a `big.Below` or `big.Above` accuracy, even though the value itself could be successfully converted into a `float64` type. This change updates the validation logic to follow the `(*big.Float).Float64()` method documentation to check the returned value, along with the `big.Accuracy`.
- Loading branch information
Showing
3 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-notes:bug | ||
types/basetypes: Fixed `Float64Type` type `Validate` method to handle valid, stringified numbers from Terraform | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters