question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a built-in parser, analogous to putState (formerly, setState) in Parsec that sets the user state and returns nothing? Is there a mechanism to replace user state without performing an explicit mutation/side effect (e.g., userState.tags.push(...) like in the examples in the readme)?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
GregRoscommented, Jul 2, 2018

@mgreenbe Interesting! I never really thought about reverting user state. And yeah, you’re right, it’s probably not possible unless I allow replacing user state in the first place.

Now that I see the reasoning, it’s definitely something I’ll add. The two techniques can be complementary.

1reaction
mgreenbecommented, Jul 1, 2018

My reasoning is twofold: A putState parser would make it really simple to port things from (F)Parsec. Second, I’d like userState state to revert if the parser needs to backtrack, and that won’t happen automatically if I’m always mutating it in place (right?).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hyperledger Fabric SDK for node.js Class: ChaincodeStub
The resulting composite key can be used as the key in putState(). Hyperledger Fabric uses a simple key/value model for saving chaincode states....
Read more >
PutState and GetState: The API in Chaincode ... - KC Tam
Overview. Ledger in Hyperledger Fabric is composed of two parts: blockchain of transaction records and world state (link).
Read more >
shim - Go Packages
Package shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.
Read more >
Chaincode for Developers - Hyperledger Fabric Docs
A chaincode can be invoked to update or query the ledger in a proposal transaction. Given the appropriate permission, a chaincode may invoke...
Read more >
Fail to putstate in hyperledger-fabric - Stack Overflow
The data is not written to the ledger when PutState() is called. The chaincode execution produces a peer endorsement to write some data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found