-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSON-API] Make key_hash idx non unique (#11102)
* Add failing test that covers the bug * Fix on conflict error for inserts into the contracts table changelog_begin - [JSON-API] make key_hash indexes non-unique, this fixes a bug where a duplicate key conflict was raised on the query store when the same contract was being witnessed twice by two separate parties changelog_end * move test to parent so as to test oracle query store * make key_hash indexes non-unique * use recordFromFields Co-authored-by: Akshay <[email protected]>
- Loading branch information
1 parent
429f437
commit 018e908
Showing
5 changed files
with
146 additions
and
4 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
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
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,27 @@ | ||
-- Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
module User where | ||
|
||
-- MAIN_TEMPLATE_BEGIN | ||
template User with | ||
username: Party | ||
following: [Party] | ||
where | ||
signatory username | ||
observer following | ||
-- MAIN_TEMPLATE_END | ||
|
||
key username: Party | ||
maintainer key | ||
|
||
-- FOLLOW_BEGIN | ||
nonconsuming choice Follow: ContractId User with | ||
userToFollow: Party | ||
controller username | ||
do | ||
assertMsg "You cannot follow yourself" (userToFollow /= username) | ||
assertMsg "You cannot follow the same user twice" (notElem userToFollow following) | ||
archive self | ||
create this with following = userToFollow :: following | ||
-- FOLLOW_END |
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