mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Update block Beacon APIs to Capella (#11706)
* proto+ssz * refactor GetBlindedBlockSSZ (cherry picked from commit 97483c339f99b0d96bd81846a979383ffd2b0cda) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go (cherry picked from commit9e4e82d2c5) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * add Capella version (cherry picked from commit 5d6fd0bbe663e5dd16df5b2e773f68982bbcd24e) (cherry picked from commit82f6ddb693) * support SSZ lol (cherry picked from commit 52bc2c8d617ac3e1254c493fa053cdce4a1ebd63) (cherry picked from commitd7d70bc25b) * update withdrawals proto * refactor and test GetBlockV2 (cherry picked from commitc1d4eaa79d) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * refactor and test GetSSZBlockV2 (cherry picked from commitfbc4e73d31) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * test other functions (cherry picked from commit31d4a4cd11) * move stuff to blinded_blocks.go (cherry picked from commit0a9e1658dd) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * fix migration code * add Capella to SubmitBlock * custom hooks * missing structs * fix tests * fix tests * review * fix build issues * replace ioutil with io Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -98,10 +98,10 @@ func TestWrapExecutionPayloadCapella(t *testing.T) {
|
||||
BlockHash: []byte("blockhash"),
|
||||
Transactions: [][]byte{[]byte("transaction")},
|
||||
Withdrawals: []*enginev1.Withdrawal{{
|
||||
WithdrawalIndex: 55,
|
||||
ValidatorIndex: 66,
|
||||
ExecutionAddress: []byte("executionaddress"),
|
||||
Amount: 77,
|
||||
Index: 55,
|
||||
ValidatorIndex: 66,
|
||||
Address: []byte("executionaddress"),
|
||||
Amount: 77,
|
||||
}},
|
||||
}
|
||||
payload, err := blocks.WrappedExecutionPayloadCapella(data)
|
||||
|
||||
@@ -1243,9 +1243,9 @@ func getFields() fields {
|
||||
},
|
||||
Withdrawals: []*enginev1.Withdrawal{
|
||||
{
|
||||
WithdrawalIndex: 128,
|
||||
ExecutionAddress: b20,
|
||||
Amount: 128,
|
||||
Index: 128,
|
||||
Address: b20,
|
||||
Amount: 128,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestPayloadAttributeGetters(t *testing.T) {
|
||||
{
|
||||
name: "Get withdrawals (capella)",
|
||||
tc: func(t *testing.T) {
|
||||
wd := []*enginev1.Withdrawal{{WithdrawalIndex: 1}, {WithdrawalIndex: 2}, {WithdrawalIndex: 3}}
|
||||
wd := []*enginev1.Withdrawal{{Index: 1}, {Index: 2}, {Index: 3}}
|
||||
a, err := New(&enginev1.PayloadAttributesV2{Withdrawals: wd})
|
||||
require.NoError(t, err)
|
||||
got, err := a.Withdrawals()
|
||||
@@ -126,7 +126,7 @@ func TestPayloadAttributeGetters(t *testing.T) {
|
||||
Timestamp: 1,
|
||||
PrevRandao: []byte{1, 2, 3},
|
||||
SuggestedFeeRecipient: []byte{4, 5, 6},
|
||||
Withdrawals: []*enginev1.Withdrawal{{WithdrawalIndex: 1}, {WithdrawalIndex: 2}, {WithdrawalIndex: 3}},
|
||||
Withdrawals: []*enginev1.Withdrawal{{Index: 1}, {Index: 2}, {Index: 3}},
|
||||
}
|
||||
a, err := New(p)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user