Remove rudimentary mentions of "magic" in RIP-7560 related code

This commit is contained in:
Alex Forshtat 2024-08-12 17:30:43 +02:00
parent 80242b7199
commit faecd257d6
2 changed files with 3 additions and 14 deletions

View file

@ -57,7 +57,7 @@ func abiDecodeAcceptAccount(input []byte) (*AcceptAccountData, error) {
if methodSelector == SigFailAccountMethodSig {
return nil, errors.New("account signature error")
}
return nil, errors.New("account did not return correct MAGIC_VALUE")
return nil, errors.New("account did not call the EntryPoint 'acceptAccount' callback")
}
acceptAccountData := &AcceptAccountData{}
err = jsonAbi.UnpackIntoInterface(acceptAccountData, "acceptAccount", input[4:])
@ -71,7 +71,7 @@ func abiDecodeAcceptPaymaster(input []byte) (*AcceptPaymasterData, error) {
}
methodSelector := new(big.Int).SetBytes(input[:4]).Uint64()
if methodSelector != AcceptPaymasterMethodSig {
return nil, errors.New("paymaster did not return correct MAGIC_VALUE")
return nil, errors.New("paymaster did not call the EntryPoint 'acceptPaymaster' callback")
}
acceptPaymasterData := &AcceptPaymasterData{}
err = jsonAbi.UnpackIntoInterface(acceptPaymasterData, "acceptPaymaster", input[4:])

View file

@ -12,7 +12,6 @@ import (
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/status-im/keycard-go/hexutils"
"math/big"
"slices"
"testing"
)
@ -158,7 +157,7 @@ func returnWithData(data []byte) []byte {
}
func createAccountCode() []byte {
return returnWithData(core.PackValidationData(core.AcceptAccountMethodSig, 0, 0))
return nil
}
// create EVM code from OpCode, byte and []bytes
@ -202,13 +201,3 @@ func createCode(items ...interface{}) []byte {
func asBytes32(a int) []byte {
return common.LeftPadBytes(big.NewInt(int64(a)).Bytes(), 32)
}
func paymasterReturnValue(magic, validUntil, validAfter uint64, context []byte) []byte {
validationData := core.PackValidationData(magic, validUntil, validAfter)
//manual encode (bytes32 validationData, bytes context)
return slices.Concat(
common.LeftPadBytes(validationData, 32),
asBytes32(64),
asBytes32(len(context)),
context)
}