|
|
@ -84,48 +84,48 @@ func TestBuildPayload(t *testing.T) { |
|
|
|
func TestPayloadId(t *testing.T) { |
|
|
|
func TestPayloadId(t *testing.T) { |
|
|
|
ids := make(map[string]int) |
|
|
|
ids := make(map[string]int) |
|
|
|
for i, tt := range []*BuildPayloadArgs{ |
|
|
|
for i, tt := range []*BuildPayloadArgs{ |
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{1}, |
|
|
|
Parent: common.Hash{1}, |
|
|
|
Timestamp: 1, |
|
|
|
Timestamp: 1, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different parent
|
|
|
|
// Different parent
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 1, |
|
|
|
Timestamp: 1, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different timestamp
|
|
|
|
// Different timestamp
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 2, |
|
|
|
Timestamp: 2, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
Random: common.Hash{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different Random
|
|
|
|
// Different Random
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 2, |
|
|
|
Timestamp: 2, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
FeeRecipient: common.Address{0x1}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different fee-recipient
|
|
|
|
// Different fee-recipient
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 2, |
|
|
|
Timestamp: 2, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different withdrawals (non-empty)
|
|
|
|
// Different withdrawals (non-empty)
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 2, |
|
|
|
Timestamp: 2, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
Withdrawals: []*types.Withdrawal{ |
|
|
|
Withdrawals: []*types.Withdrawal{ |
|
|
|
&types.Withdrawal{ |
|
|
|
{ |
|
|
|
Index: 0, |
|
|
|
Index: 0, |
|
|
|
Validator: 0, |
|
|
|
Validator: 0, |
|
|
|
Address: common.Address{}, |
|
|
|
Address: common.Address{}, |
|
|
@ -134,13 +134,13 @@ func TestPayloadId(t *testing.T) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
// Different withdrawals (non-empty)
|
|
|
|
// Different withdrawals (non-empty)
|
|
|
|
&BuildPayloadArgs{ |
|
|
|
{ |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Parent: common.Hash{2}, |
|
|
|
Timestamp: 2, |
|
|
|
Timestamp: 2, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
Random: common.Hash{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
FeeRecipient: common.Address{0x2}, |
|
|
|
Withdrawals: []*types.Withdrawal{ |
|
|
|
Withdrawals: []*types.Withdrawal{ |
|
|
|
&types.Withdrawal{ |
|
|
|
{ |
|
|
|
Index: 2, |
|
|
|
Index: 2, |
|
|
|
Validator: 0, |
|
|
|
Validator: 0, |
|
|
|
Address: common.Address{}, |
|
|
|
Address: common.Address{}, |
|
|
|