mirror of
https://github.com/luxfi/precompile.git
synced 2026-09-24 00:26:21 +00:00
chore: sync dependencies and format code
This commit is contained in:
@@ -153,11 +153,11 @@ func (m *MockPrecompileEnv) ReadOnly() bool {
|
||||
|
||||
// MockAccessibleState implements AccessibleState interface for testing
|
||||
type MockAccessibleState struct {
|
||||
stateDB StateDB
|
||||
blockContext BlockContext
|
||||
chainConfig precompileconfig.ChainConfig
|
||||
precompileEnv PrecompileEnvironment
|
||||
activated bool // for activation tests
|
||||
stateDB StateDB
|
||||
blockContext BlockContext
|
||||
chainConfig precompileconfig.ChainConfig
|
||||
precompileEnv PrecompileEnvironment
|
||||
activated bool // for activation tests
|
||||
}
|
||||
|
||||
func NewMockAccessibleState(stateDB StateDB, blockContext BlockContext) *MockAccessibleState {
|
||||
|
||||
@@ -208,6 +208,7 @@ golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4
|
||||
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU=
|
||||
golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU=
|
||||
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
|
||||
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
@@ -218,7 +219,9 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
|
||||
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
|
||||
@@ -130,8 +130,8 @@ func containsField(query, field string) bool {
|
||||
// Simple string match - real implementation would parse AST
|
||||
return len(query) > 0 && len(field) > 0 &&
|
||||
(contains(query, field+" ") || contains(query, field+"{") ||
|
||||
contains(query, field+"(") || contains(query, field+"}") ||
|
||||
contains(query, field+"\n") || contains(query, field+"\t"))
|
||||
contains(query, field+"(") || contains(query, field+"}") ||
|
||||
contains(query, field+"\n") || contains(query, field+"\t"))
|
||||
}
|
||||
|
||||
func contains(s, substr string) bool {
|
||||
|
||||
@@ -305,9 +305,9 @@ func TestCoronaPrecompile_TruncatedPubKey(t *testing.T) {
|
||||
|
||||
// [mode(1)] [pubkey_len(2)] but pubkey is truncated
|
||||
input := make([]byte, 10)
|
||||
input[0] = 0x01 // mode
|
||||
input[1] = 0x00 // pubkey_len high byte
|
||||
input[2] = 0x20 // pubkey_len low byte = 32
|
||||
input[0] = 0x01 // mode
|
||||
input[1] = 0x00 // pubkey_len high byte
|
||||
input[2] = 0x20 // pubkey_len low byte = 32
|
||||
// Only 7 bytes of pubkey follow (input[3:10])
|
||||
|
||||
ret, _, err := r.Run(nil, common.Address{}, r.Address(), input, CoronaVerifyGas, true)
|
||||
@@ -321,9 +321,9 @@ func TestCoronaPrecompile_TruncatedMessage(t *testing.T) {
|
||||
// Build input with pubkey present but message truncated
|
||||
pubKeyLen := 32
|
||||
input := make([]byte, 3+pubKeyLen+2) // mode + pubkey_len + pubkey + msg_len (no msg body)
|
||||
input[0] = 0x01 // mode
|
||||
input[1] = 0x00 // pubkey_len high
|
||||
input[2] = byte(pubKeyLen) // pubkey_len low
|
||||
input[0] = 0x01 // mode
|
||||
input[1] = 0x00 // pubkey_len high
|
||||
input[2] = byte(pubKeyLen) // pubkey_len low
|
||||
// pubkey bytes: input[3:35]
|
||||
input[3+pubKeyLen] = 0x00 // msg_len high
|
||||
input[3+pubKeyLen+1] = 0x10 // msg_len low = 16
|
||||
@@ -343,9 +343,9 @@ func TestCoronaPrecompile_InvalidPubKey(t *testing.T) {
|
||||
sigLen := 3293 // ML-DSA-65 signature size
|
||||
|
||||
input := make([]byte, 1+2+pubKeyLen+2+msgLen+sigLen)
|
||||
input[0] = 0x01 // mode (MLDSA65 = 1)
|
||||
input[1] = byte(pubKeyLen >> 8) // pubkey_len high
|
||||
input[2] = byte(pubKeyLen & 0xFF) // pubkey_len low
|
||||
input[0] = 0x01 // mode (MLDSA65 = 1)
|
||||
input[1] = byte(pubKeyLen >> 8) // pubkey_len high
|
||||
input[2] = byte(pubKeyLen & 0xFF) // pubkey_len low
|
||||
input[3+pubKeyLen] = byte(msgLen >> 8)
|
||||
input[3+pubKeyLen+1] = byte(msgLen & 0xFF)
|
||||
// Leave everything zeros - invalid pubkey
|
||||
|
||||
Reference in New Issue
Block a user