-
Notifications
You must be signed in to change notification settings - Fork 104
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
enforce protocol limits on account updates and events #620
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6d6f52f
impl party limit
Trivo25 09f0c9b
rm debug log
Trivo25 882d230
todo comment
Trivo25 d3517f9
move verifyTransactionLimits to tx.send
Trivo25 b024f22
add types of updates to error msg
Trivo25 ddd61e1
Update CHANGELOG.md
Trivo25 75587ea
add flag to local blockchain and export helpers for tests
Trivo25 9e11eea
tests
Trivo25 76135e9
fix ci
Trivo25 837ca2f
fix tests
Trivo25 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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,104 @@ | ||
import { filterGroups } from './mina.js'; | ||
import { expect } from 'expect'; | ||
import { shutdown } from '../index.js'; | ||
|
||
let S = 'Signature'; | ||
let N = 'None_given'; | ||
let P = 'Proof'; | ||
|
||
expect(filterGroups([S, S, S, S, S, S])).toEqual({ | ||
proof: 0, | ||
signedPair: 3, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([N, N, N, N, N, N])).toEqual({ | ||
proof: 0, | ||
signedPair: 3, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([N, S, S, N, N, S])).toEqual({ | ||
proof: 0, | ||
signedPair: 3, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([S, P, S, S, S, S])).toEqual({ | ||
proof: 1, | ||
signedPair: 2, | ||
signedSingle: 1, | ||
}); | ||
|
||
expect(filterGroups([N, P, N, P, N, P])).toEqual({ | ||
proof: 3, | ||
signedPair: 0, | ||
signedSingle: 3, | ||
}); | ||
|
||
expect(filterGroups([N, P])).toEqual({ | ||
proof: 1, | ||
signedPair: 0, | ||
signedSingle: 1, | ||
}); | ||
|
||
expect(filterGroups([N, S])).toEqual({ | ||
proof: 0, | ||
signedPair: 1, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([P, P])).toEqual({ | ||
proof: 2, | ||
signedPair: 0, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([P, P, S, N, N])).toEqual({ | ||
proof: 2, | ||
signedPair: 1, | ||
signedSingle: 1, | ||
}); | ||
|
||
expect(filterGroups([P])).toEqual({ | ||
proof: 1, | ||
signedPair: 0, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([S])).toEqual({ | ||
proof: 0, | ||
signedPair: 0, | ||
signedSingle: 1, | ||
}); | ||
|
||
expect(filterGroups([N])).toEqual({ | ||
proof: 0, | ||
signedPair: 0, | ||
signedSingle: 1, | ||
}); | ||
|
||
expect(filterGroups([N, N])).toEqual({ | ||
proof: 0, | ||
signedPair: 1, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([N, S])).toEqual({ | ||
proof: 0, | ||
signedPair: 1, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([S, N])).toEqual({ | ||
proof: 0, | ||
signedPair: 1, | ||
signedSingle: 0, | ||
}); | ||
|
||
expect(filterGroups([S, S])).toEqual({ | ||
proof: 0, | ||
signedPair: 1, | ||
signedSingle: 0, | ||
}); | ||
shutdown(); |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we should eventually add this to auto-generation via the
snarky_js_constants.ml
mechanism, so it'd guaranteed to stay in sync. It's not urgent though and can be an issue for later