generated from flashbots/flashbots-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Float to U256 test, other minor review changes
- Loading branch information
allboxes
committed
Oct 7, 2022
1 parent
648040f
commit 0818f35
Showing
3 changed files
with
23 additions
and
6 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,16 @@ | ||
package cli | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/flashbots/go-boost-utils/types" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestFloatEthTo256Wei(t *testing.T) { | ||
// test with valid input | ||
i := 0.000000000000012345 | ||
u256, err := floatEthTo256Wei(i) | ||
require.Equal(t, types.IntToU256(12345), *u256) | ||
require.NoError(t, err) | ||
} |
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