-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ncli verifyDeposit: a simple helper for inspecting deposit events
- Loading branch information
Showing
6 changed files
with
148 additions
and
49 deletions.
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 |