mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Change native execution value to Gwei Uint64 (#12291)
* Default value to uint64 * Fix spectest * Fix tests * Fix tests * Fix tests * Fix test * Fix test * Fix build * Potuz feedback * Add test * Fix test * Fix test
This commit is contained in:
@@ -3,6 +3,7 @@ package math_test
|
||||
import (
|
||||
"fmt"
|
||||
stdmath "math"
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/math"
|
||||
@@ -549,3 +550,20 @@ func TestAddInt(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestWeiToGwei(t *testing.T) {
|
||||
tests := []struct {
|
||||
v *big.Int
|
||||
want uint64
|
||||
}{
|
||||
{big.NewInt(1e9 - 1), 0},
|
||||
{big.NewInt(1e9), 1},
|
||||
{big.NewInt(1e10), 10},
|
||||
{big.NewInt(239489233849348394), 239489233},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
if got := math.WeiToGwei(tt.v); got != tt.want {
|
||||
t.Errorf("WeiToGwei() = %v, want %v", got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user