* Avoid one indirection for dictionary construction
For every constructor `Foo` we generate a function `$ctor:Foo` which calls
the DAML-LF constructor for `Foo`. This function is useless since GHC already
creates a function `$WFoo` for us which does the same. This PR remove the
`$ctor:...` functions for type class dictionaries.
This makes a bit of a mess in the `Ctors` data type. This will be cleaned up
when all `$ctor:...` functions are finally gone.
* Fix construction of XInstance templates
This is a small step to solve the package name ambiguity problem.
Putting the package version into the package name allows to import a
package two times with different versions.
* use Arbitrary for TypedValueGenerators to get existing 'sized' uses
* test Option[Option[Long]] specifically
* derive Arbitrary ValueMap solely by implicit means, for the sized
* make ApiCodecCompressed Cid-generic
* first sample JSON tests
* navigator adaptation to Cid genericity
* scalafmt
* Table-ify JSON tests
* more navigator adaptation
* adapt http-json to Cid-agnostic JSON codec
* stem the tide of namespace pollution wrought by the "mixin to import" style
* show line # of failed JSON cases
* naturally limit the nesting factor of generated types
* move SortedLookupList generation to data-scalacheck library
* more sample JSON cases from design doc
* add more parameters to ApiCodecCompressed
- AbsoluteContractId seems like it will give rise to incoherence
- and there are going to be two parameters
- so we might as well just parameterize the whole codec
* test canonical and equivalent encoded forms
* test lists
* test very very nested optionals
* many more optional-related tests
For example, we print two spaces if there's no annotation between `def` and
the function. This PR fixes this by using the `empty` document instead of the
document containing the empty string. (Please don't ask me why they are
different.)
This happened because we translate empty workflow ids to None in the
API-to-domain translation layer. When we store the workflow id, we actually
convert the None case back to an empty string (and not a null value).
When loading the workflow id from the database, we parse the column as a regular
LedgerString, but unfortunately these cannot be empty. Therefore using empty workflow
ids on postgres has been broken since workflow id has changed from a tagged string
to LedgerString.
* Add link to deploy URL in daml ledger --help and daml deploy --help
* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs
Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
* Starting //ledger-service/jwt module
adding //3rdparty/jvm/com/auth0:java_jwt dependency, there are Scala JWT
libraries, however they are either immature or unsupported
* Keys and JWT generator utility/wrapper, WIP
* Keys and JWT generator utility/wrapper, WIP
* RSA Keys generator
* HMAC token validation added to command/create endpoint
HMAC is actually not good, need RSA, this is a shortcut for DABL team.
* Renaming
* command/create test cases fixed to pass OAth2 Bearer token
* removing unused method
* JWT authorization for /command/exercise
* the rest of the endpoints uses JWT authorization
removed hardcoded JwtPayload
* cleanup
* cleanup
* http status code in the header and in the json body should match now
* NotFound would also return a json body now
* Removing hardcoded JWT in the integration test
it is generated using the JwtSigner.HMAC256
* cleanup
* fixing error message
* instructions for making a JWT HMAC token for dev
Comparing FilePaths is really slow so by mapping them to Ints, we can
speed up dependency chasing significantly.
We might want to switch to doing some kind of global hash consing of
file paths at the Shake level but for now, this seems like a nice
improvement while not being too invasive.
This is roughly an ~8s speedup on my testcase.
Despite, a lot of searching around, I couldn’t find any information on
why exactly quoting "code" causes issues but removing the quotes seems
to fix the issue ¯\_(ツ)_/¯
Until now the test used the manually desugared syntax for the `Iou`
template. Now, we use the proper `template` syntax. The test is also
renamed from `IouDSL` to `ProposalIou` since the DSL would be confusing
after this change. In fact, we're mostly testing that the
instantiation of `Proposal a` with `a = Iou` actually works.
* Remove tests that are obsolete with new template desugaring
The tests were only relevant during the transition phase to the new
template desugaring. Since that desugaring has landed the test don't
provide value anymore and can be deleted.
* Fix super class dictionary detection
* Use tasty-golden for daml-doc's golden tests
With our hand rolled version of golden tests it is pretty painful to update
the golden files when they must change. After this PR it is as simple as
```
> bazel run //compiler/damlc/tests:daml-doc -- --accept
```
* Address indentation issues
* Use diff command line tool for diffing
* Removed new unused dependecy on Diff package
* Ignore carriage returns in diff
This allows us to GC the unsimplified DALF which decreases memory
usage and GC pressure. This does make GenerateRawDalf slightly slower
which could in theory have an effect on IDE performance since we use
the raw DALF for the scenario service. However, I haven’t been able to
measure any regressions (if it does become an issue, we could disable
optimizations completely in the IDE). In fact, things seem to be
slightly faster.
On my testcase max memory usage does seem to go down a bit but not a
lot (3.0GB to 2.7GB but it fluctuates somewhat between runs).