-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get TxMetadata from blocks on chain #2079
Conversation
, metadata | ||
:: !(Maybe TxMetadata) | ||
-- ^ Semi-structured application-specific extension data stored in the | ||
-- transaction on chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
-- Compare metadatas by json encoding | ||
instance Ord TxMetadata where | ||
compare = comparing (Aeson.encode . unTxMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale here ? Why not rely on the existing Ord
instance for Value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value
has no Ord
... nor does Cardano.Api.TxMetadata
.
I define it by string encoding so that other types can keep their Ord
constraint.
59d4386
to
95aac1f
Compare
@@ -555,6 +558,9 @@ data ApiTransaction (n :: NetworkDiscriminant) = ApiTransaction | |||
, outputs :: ![AddressAmount (ApiT Address, Proxy n)] | |||
, withdrawals :: ![ApiWithdrawal n] | |||
, status :: !(ApiT TxStatus) | |||
-- fixme: #2073 not sure whether empty metadata should be null or missing | |||
-- key. | |||
, metadata :: !(Maybe (ApiT TxMetadata)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My own preference is to have a null
value so that it is more explicit client side but I admit not being 100% sure about how the default aeson generic options treat this in our API at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is also my preference actually. But when submitting a transaction, it is more convenient for users if they can omit the key. Our default generic options are to omit Nothing fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will sort it out in #2089.
cardano-1.19.x.yaml
Outdated
@@ -60,7 +60,7 @@ packages: | |||
- Win32-2.6.2.0 | |||
|
|||
- git: https://github.com/input-output-hk/cardano-base | |||
commit: df8687488449f71dce3d881800c21e41fe1b7fc1 | |||
commit: 3e2d92b25c675fd923a07237eb1d0859b29a79d3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn. This completely breaks the linker when building with stack for me. I am trying on a completely clean stack root now because It reminds me of a past issue with stack not correctly figuring out links between same packages of different snapshots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think the YAML filename needs to be different so that stack knows that something's changed. But I couldn't think of a good name for a version somewhere between 1.19.0 and 1.20.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to bump this library so that the shelley-spec-ledger-test
package would build. This was just to get access to the TxMetadata
test generators. But that has caused more problems with multiple Arbitrary
instances of other types. It's just not worth it. I will copy&paste the Arbitrary
instance.
dcd6bfe
to
9660fd1
Compare
-- transaction on chain. | ||
-- | ||
-- This is not to be confused with 'TxMeta', which is information about | ||
-- a transaction derived from the ledger. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, we might want to rename TxMeta
at some point indeed.
, " - \"v1\"" | ||
, " - key: 0" | ||
, " - val: \"value\"" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
9660fd1
to
c003df8
Compare
bors r+ |
2079: Get TxMetadata from blocks on chain r=rvl a=rvl ### Issue Number ADP-307 / #2077 ### Overview - Initial types, etc. ### Comments - I don't have any serialized block data to make golden tests. But the testing can be done with integration tests. 2088: Bump cardano-base so that shelley-spec-ledger-test compiles r=rvl a=rvl ### Issue Number Found during #2077. ### Overview If you are keen enough to build the test suites of all our dependencies, you would have found `shelley-spec-ledger-test` failing to compile, because it needs a later revision of `cardano-base`. This will fix it. 2092: Fix stack build on windows r=rvl a=rvl ### Issue Number None ### Overview On windows, the stack build would fail with some missing dependencies. There is some stack issue with GHC boot packages. The recommended course of action is to add them as `extra-deps` in `stack.yaml`. This fixes the build. ### Comments Since the libsodium VRF was added, there is now an extra step to get stack builds working on windows. I have updated our [iohk-setup.ps1](https://github.com/input-output-hk/adrestia/wiki/scripts/iohk-setup.ps1) script to install libsodium and configure stack to use it. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: IOHK <[email protected]>
Build failed (retrying...) |
Canceled |
b0c33cf
to
b9d1b1a
Compare
b9d1b1a
to
d7ca998
Compare
Since we have added shelley libs as dependencies to the core library, all executables now link with libsodium. So the nix needed to be updated so that bors r+ |
Build succeeded |
2091: Add tx metadata to sqlite database r=rvl a=rvl ### Issue Number ADP-307 / #2072 ### Overview Includes transaction metadata in the sqlite database transaction history. ### Comments - Based on PR #2079 branch - DB state machine tests fail. Possibly due to mutations during the TxMetadata json round-trip. Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: KtorZ <[email protected]>
Issue Number
ADP-307 / #2077
Overview
Comments