accounts/abi: move U256Bytes to common/math (#21020)

This commit is contained in:
Marius van der Wijden
2020-05-04 14:09:14 +02:00
committed by GitHub
parent e872083d44
commit ab72803e6f
9 changed files with 22 additions and 48 deletions

View File

@ -212,6 +212,16 @@ func TestU256(t *testing.T) {
}
}
func TestU256Bytes(t *testing.T) {
ubytes := make([]byte, 32)
ubytes[31] = 1
unsigned := U256Bytes(big.NewInt(1))
if !bytes.Equal(unsigned, ubytes) {
t.Errorf("expected %x got %x", ubytes, unsigned)
}
}
func TestBigEndianByteAt(t *testing.T) {
tests := []struct {
x string