mirror of https://github.com/status-im/nim-eth.git
Fix Authorization fields name to v, r, s (#749)
This commit is contained in:
parent
470baf82bd
commit
b736906dc7
|
@ -69,8 +69,8 @@ jobs:
|
||||||
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
|
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
|
||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo apt-fast update -qq
|
sudo apt-get update -qq
|
||||||
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
|
sudo DEBIAN_FRONTEND='noninteractive' apt-get install \
|
||||||
--no-install-recommends -yq gcc-multilib g++-multilib \
|
--no-install-recommends -yq gcc-multilib g++-multilib \
|
||||||
libz-dev:i386 libbz2-dev:i386 liblz4-dev:i386 libssl-dev:i386
|
libz-dev:i386 libbz2-dev:i386 liblz4-dev:i386 libssl-dev:i386
|
||||||
mkdir -p external/bin
|
mkdir -p external/bin
|
||||||
|
|
|
@ -33,12 +33,12 @@ type
|
||||||
## AKA mix_digest in some specs - Hash32 in the eth API but Bytes32 in
|
## AKA mix_digest in some specs - Hash32 in the eth API but Bytes32 in
|
||||||
## the execution API and spec!
|
## the execution API and spec!
|
||||||
nonce*: Bytes8
|
nonce*: Bytes8
|
||||||
baseFeePerGas*: Opt[UInt256] # EIP-1559
|
baseFeePerGas*: Opt[UInt256] # EIP-1559
|
||||||
withdrawalsRoot*: Opt[Hash32] # EIP-4895
|
withdrawalsRoot*: Opt[Hash32] # EIP-4895
|
||||||
blobGasUsed*: Opt[uint64] # EIP-4844
|
blobGasUsed*: Opt[uint64] # EIP-4844
|
||||||
excessBlobGas*: Opt[uint64] # EIP-4844
|
excessBlobGas*: Opt[uint64] # EIP-4844
|
||||||
parentBeaconBlockRoot*: Opt[Hash32] # EIP-4788
|
parentBeaconBlockRoot*: Opt[Hash32] # EIP-4788
|
||||||
requestsRoot*: Opt[Hash32] # EIP-7685
|
requestsHash*: Opt[Hash32] # EIP-7685
|
||||||
|
|
||||||
# starting from EIP-4399, `mixDigest` field is called `prevRandao`
|
# starting from EIP-4399, `mixDigest` field is called `prevRandao`
|
||||||
template prevRandao*(h: Header): Bytes32 =
|
template prevRandao*(h: Header): Bytes32 =
|
||||||
|
|
|
@ -24,9 +24,9 @@ type
|
||||||
chainId*: ChainId
|
chainId*: ChainId
|
||||||
address*: Address
|
address*: Address
|
||||||
nonce*: AccountNonce
|
nonce*: AccountNonce
|
||||||
yParity*: uint64
|
v*: uint64
|
||||||
R*: UInt256
|
r*: UInt256
|
||||||
S*: UInt256
|
s*: UInt256
|
||||||
|
|
||||||
TxType* = enum
|
TxType* = enum
|
||||||
TxLegacy # 0
|
TxLegacy # 0
|
||||||
|
|
|
@ -76,9 +76,9 @@ proc append*(w: var RlpWriter, x: Authorization) =
|
||||||
w.append(x.chainId.uint64)
|
w.append(x.chainId.uint64)
|
||||||
w.append(x.address)
|
w.append(x.address)
|
||||||
w.append(x.nonce)
|
w.append(x.nonce)
|
||||||
w.append(x.yParity)
|
w.append(x.v)
|
||||||
w.append(x.R)
|
w.append(x.r)
|
||||||
w.append(x.S)
|
w.append(x.s)
|
||||||
|
|
||||||
proc appendTxEip7702(w: var RlpWriter, tx: Transaction) =
|
proc appendTxEip7702(w: var RlpWriter, tx: Transaction) =
|
||||||
w.startList(13)
|
w.startList(13)
|
||||||
|
@ -310,9 +310,9 @@ proc read*(rlp: var Rlp, T: type Authorization): T {.raises: [RlpError].} =
|
||||||
result.chainId = rlp.read(uint64).ChainId
|
result.chainId = rlp.read(uint64).ChainId
|
||||||
rlp.read(result.address)
|
rlp.read(result.address)
|
||||||
rlp.read(result.nonce)
|
rlp.read(result.nonce)
|
||||||
rlp.read(result.yParity)
|
rlp.read(result.v)
|
||||||
rlp.read(result.R)
|
rlp.read(result.r)
|
||||||
rlp.read(result.S)
|
rlp.read(result.s)
|
||||||
|
|
||||||
proc readTxEip7702(rlp: var Rlp, tx: var Transaction) {.raises: [RlpError].} =
|
proc readTxEip7702(rlp: var Rlp, tx: var Transaction) {.raises: [RlpError].} =
|
||||||
tx.txType = TxEip7702
|
tx.txType = TxEip7702
|
||||||
|
|
|
@ -26,9 +26,9 @@ const
|
||||||
chainID: 1.ChainId,
|
chainID: 1.ChainId,
|
||||||
address: source,
|
address: source,
|
||||||
nonce: 2.AccountNonce,
|
nonce: 2.AccountNonce,
|
||||||
yParity: 3,
|
v: 3,
|
||||||
R: 4.u256,
|
r: 4.u256,
|
||||||
S: 5.u256
|
s: 5.u256
|
||||||
)]
|
)]
|
||||||
|
|
||||||
proc tx0(i: int): PooledTransaction =
|
proc tx0(i: int): PooledTransaction =
|
||||||
|
|
Loading…
Reference in New Issue