Skip to content

Commit 7098d42

Browse files
jwasingerMariusVanDerWijden
authored andcommitted
add test cases from the EIP
1 parent f84d15f commit 7098d42

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

core/vm/contracts_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var allPrecompiles = map[common.Address]PrecompiledContract{
5252
common.BytesToAddress([]byte{4}): &dataCopy{},
5353
common.BytesToAddress([]byte{5}): &bigModExp{eip2565: false},
5454
common.BytesToAddress([]byte{0xf5}): &bigModExp{eip2565: true},
55+
common.BytesToAddress([]byte{0xf6}): &bigModExp{eip2565: true, eip7883: true},
5556
common.BytesToAddress([]byte{6}): &bn256AddIstanbul{},
5657
common.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{},
5758
common.BytesToAddress([]byte{8}): &bn256PairingIstanbul{},
@@ -238,6 +239,9 @@ func BenchmarkPrecompiledModExp(b *testing.B) { benchJson("modexp", "05", b) }
238239
func TestPrecompiledModExpEip2565(t *testing.T) { testJson("modexp_eip2565", "f5", t) }
239240
func BenchmarkPrecompiledModExpEip2565(b *testing.B) { benchJson("modexp_eip2565", "f5", b) }
240241

242+
func TestPrecompiledModExpEip7883(t *testing.T) { testJson("modexp_eip7883", "f6", t) }
243+
func BenchmarkPrecompiledModExpEip7883(b *testing.B) { benchJson("modexp_eip7883", "f6", b) }
244+
241245
// Tests the sample inputs from the elliptic curve addition EIP 213.
242246
func TestPrecompiledBn256Add(t *testing.T) { testJson("bn256Add", "06", t) }
243247
func BenchmarkPrecompiledBn256Add(b *testing.B) { benchJson("bn256Add", "06", b) }

0 commit comments

Comments
 (0)