forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daml-lf: clone dev protobuf for LF 1.7 (digital-asset#3371)
- Loading branch information
1 parent
c599f24
commit ce36674
Showing
7 changed files
with
1,514 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
54 changes: 54 additions & 0 deletions
54
daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf.proto
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,54 @@ | ||
// Copyright (c) 2019 The DAML Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
syntax = "proto3"; | ||
package daml_lf_1_7; | ||
|
||
option java_package = "com.digitalasset.daml_lf_1_7"; | ||
option csharp_namespace = "Com.DigitalAsset.Daml_Lf_1_7.DamlLf"; | ||
|
||
import "com/digitalasset/daml_lf_1_7/daml_lf_0.proto"; | ||
import "com/digitalasset/daml_lf_1_7/daml_lf_1.proto"; | ||
|
||
message ArchivePayload { | ||
// this is number 3 for historical reasons -- we had | ||
// DAML-LF v0 and v1 before we had minor versions. | ||
string minor = 3; | ||
reserved 9999; // for the removed "dev" major version | ||
|
||
oneof Sum { | ||
daml_lf_0.Package daml_lf_0 = 1; | ||
daml_lf_1.Package daml_lf_1 = 2; | ||
|
||
// lf_2 = 4, lf_3 = 5, etc | ||
} | ||
} | ||
|
||
enum HashFunction { | ||
SHA256 = 0; | ||
} | ||
|
||
message Archive { | ||
HashFunction hash_function = 1; | ||
|
||
// deprecated field (bytes hash = 2), replaced by | ||
// field 4. | ||
|
||
// Must be an encoded ArchivePayload. We store it as `bytes` to | ||
// simplify hashing and in future signing. | ||
bytes payload = 3; | ||
// The hash is simply the ascii7 lowercase hex-encoded hash of the bytes | ||
// according to the hash_function. We store it here for convenience, code | ||
// reading the Archive should verify that the hash is valid. | ||
// | ||
// Note that the hash is computed directly on the blob and not | ||
// on the decoded structure. This means that servers implementing | ||
// a DAML ledger need to store the blob as-is somewhere to be able | ||
// to always offer proof that they have a DAML package matching | ||
// the requested hash. We decided to go for this route rather than | ||
// relying on a canonical encoding of the AST since such a scheme | ||
// would be extremely hard (for example protobuf encoding is not | ||
// canonical) to maintain and does not buy us much. | ||
string hash = 4; | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_0.proto
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,17 @@ | ||
// Copyright (c) 2019 The DAML Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// DAML-LF-0 was a .proto representation of the DAML core stored in | ||
// the legacy sdaml format. We used it to ease transition between | ||
// sdaml and DAML-LF archives. This stub remains so we can | ||
// successfully decode LFv0 archives and then report that they are | ||
// unsupported. | ||
|
||
syntax = "proto3"; | ||
package daml_lf_0; | ||
|
||
option java_package = "com.digitalasset.daml_lf_1_7"; | ||
option csharp_namespace = "Com.DigitalAsset.Daml_Lf_1_7.DamlLf0"; | ||
|
||
message Package { | ||
} |
Oops, something went wrong.