-
Notifications
You must be signed in to change notification settings - Fork 265
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
ncli verifyDeposit: a simple helper for inspecting deposit events #3855
Open
zah
wants to merge
1
commit into
unstable
Choose a base branch
from
ncli-verifyDeposit
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import | ||
../spec/[crypto, digest] | ||
|
||
func parseCmdArg*(T: type Eth2Digest, input: string): T | ||
{.raises: [ValueError, Defect].} = | ||
Eth2Digest.fromHex(input) | ||
|
||
func completeCmdArg*(T: type Eth2Digest, input: string): seq[string] = | ||
return @[] | ||
|
||
func parseCmdArg*(T: type ValidatorPubKey, input: string): T | ||
{.raises: [ValueError, Defect].} = | ||
let res = ValidatorPubKey.fromHex(input) | ||
if res.isErr(): raise (ref ValueError)(msg: $res.error()) | ||
res.get() | ||
|
||
func completeCmdArg*(T: type ValidatorPubKey, input: string): seq[string] = | ||
return @[] | ||
|
||
func parseCmdArg*(T: type ValidatorSig, input: string): T | ||
{.raises: [ValueError, Defect].} = | ||
let res = ValidatorSig.fromHex(input) | ||
if res.isErr(): raise (ref ValueError)(msg: $res.error()) | ||
res.get() | ||
|
||
func completeCmdArg*(T: type ValidatorSig, input: string): seq[string] = | ||
return @[] |
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,26 @@ | ||
import | ||
web3, web3/ethtypes | ||
|
||
export | ||
web3, ethtypes | ||
|
||
type | ||
PubKeyBytes* = DynamicBytes[48, 48] | ||
WithdrawalCredentialsBytes* = DynamicBytes[32, 32] | ||
SignatureBytes* = DynamicBytes[96, 96] | ||
Int64LeBytes* = DynamicBytes[8, 8] | ||
|
||
contract(DepositContract): | ||
proc deposit(pubkey: PubKeyBytes, | ||
withdrawalCredentials: WithdrawalCredentialsBytes, | ||
signature: SignatureBytes, | ||
deposit_data_root: FixedBytes[32]) | ||
|
||
proc get_deposit_root(): FixedBytes[32] | ||
proc get_deposit_count(): Int64LeBytes | ||
|
||
proc DepositEvent(pubkey: PubKeyBytes, | ||
withdrawalCredentials: WithdrawalCredentialsBytes, | ||
amount: Int64LeBytes, | ||
signature: SignatureBytes, | ||
index: Int64LeBytes) {.event.} |
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
Submodule nim-web3
updated
12 files
+4 −3 | tests/all_tests.nim | |
+3 −4 | tests/test.nim | |
+41 −0 | tests/test_quantity.nim | |
+1 −1 | tests/test_utils.nim | |
+1 −1 | web3.nim | |
+2 −3 | web3/confutils_defs.nim | |
+62 −37 | web3/conversions.nim | |
+2 −2 | web3/encoding.nim | |
+0 −1 | web3/engine_api.nim | |
+9 −10 | web3/ethhexstrings.nim | |
+3 −3 | web3/ethtypes.nim | |
+2 −2 | web3/transaction_signing.nim |
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.
this import is quite unfortunate: it brings in the entirerty of web3 which transitively imports lots and lots of completely irrelevant stuff just to get access to a trivial byte converter