Skip to content

fix local server issue. closes #347 #348

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsoeldner
Copy link
Member

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • (If Relevant) Documentation has been (manually) updated at https://docs.kadena.io/pact

Additionally, please justify why you should or should not do the following:

  • Benchmark regressions
  • Confirm replay/back compat (Ignore until core release)
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact (Ignore until core release)

@@ -136,6 +136,17 @@ tests = withResource
assertStatus 200 res
let (Just (LocalResponse cmdResult)) :: Maybe LocalResponse = A.decodeStrict $ LBS.toStrict reqResp
liftIO $ assertEqual "Result match expected output" (PactResultOk $ PInteger 3) (_crResult cmdResult)

, mkTestCase env "regression #347 (tx validated on local, rejected on send)" $ do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a few test cases that local doesn't modify the DB? So a few off the top of my head:

  • Sending a command in local then a command in send (Allowed, should be same command)
  • Sending the same local request twice (Should be allowed)
  • Sending a local request that would manipulate state, and ensure it does not (Try incrementing some module-stored counter and check that the result is the same in two subsequent transactions)
  • Sending a command then sending it again in local (this should not be allowed)

StoreMsg rk cmd result -> _histDbRead (_srHistoryDb env) rk >>= \case
Nothing -> _histDbInsert (_srHistoryDb env) rk cmd >>= \case
Right _ -> putMVar result PESuccess
Left e -> putMVar result (PEUnknownException e)
Right _ -> putMVar result PESuccess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not usually nitpicking on style, but why is the indent so much more dramatic here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants