Esempio n. 1
0
            public void SendUserOperation(Address entryPoint, UserOperation userOperation)
            {
                ResultWrapper <Keccak> resultOfUserOperation = UserOperationPool[entryPoint].AddUserOperation(userOperation);

                resultOfUserOperation.GetResult().ResultType.Should().NotBe(ResultType.Failure, resultOfUserOperation.Result.Error);
                resultOfUserOperation.GetData().Should().Be(userOperation.CalculateRequestId(entryPoint, SpecProvider.ChainId));
            }
Esempio n. 2
0
            public void SendUserOperation(UserOperation userOperation)
            {
                ResultWrapper <Keccak> resultOfUserOperation = UserOperationPool.AddUserOperation(userOperation);

                resultOfUserOperation.GetResult().ResultType.Should().NotBe(ResultType.Failure, resultOfUserOperation.Result.Error);
                resultOfUserOperation.GetData().Should().Be(userOperation.CalculateRequestId(new Address(_accountAbstractionConfig.EntryPointContractAddress), SpecProvider.ChainId));
            }
            public MevBundle SendBundle(int blockNumber, params BundleTransaction[] txs)
            {
                byte[][]             bundleBytes       = txs.Select(t => Rlp.Encode(t, RlpBehaviors.SkipTypedWrapping).Bytes).ToArray();
                Keccak[]             revertingTxHashes = txs.Where(t => t.CanRevert).Select(t => t.Hash !).ToArray();
                MevBundleRpc         mevBundleRpc      = new() { BlockNumber = blockNumber, Txs = bundleBytes, RevertingTxHashes = revertingTxHashes };
                ResultWrapper <bool> resultOfBundle    = MevRpcModule.eth_sendBundle(mevBundleRpc);

                resultOfBundle.GetResult().ResultType.Should().NotBe(ResultType.Failure);
                resultOfBundle.GetData().Should().Be(true);
                return(new MevBundle(blockNumber, txs));
            }
        }
Esempio n. 4
0
            public void SupportedEntryPoints()
            {
                ResultWrapper <Address[]> resultOfEntryPoints = AccountAbstractionRpcModule.eth_supportedEntryPoints();

                resultOfEntryPoints.GetResult().ResultType.Should().NotBe(ResultType.Failure, resultOfEntryPoints.Result.Error);
                IList <Address> entryPointContractAddresses        = new List <Address>();
                IList <string>  _entryPointContractAddressesString = _accountAbstractionConfig.GetEntryPointAddresses().ToList();

                foreach (string _addressString in _entryPointContractAddressesString)
                {
                    bool parsed = Address.TryParse(
                        _addressString,
                        out Address? entryPointContractAddress);
                    entryPointContractAddresses.Add(entryPointContractAddress !);
                }

                Address[] eps          = entryPointContractAddresses.ToArray();
                Address[] recieved_eps = (Address[])(resultOfEntryPoints.GetData());
                Assert.AreEqual(eps, recieved_eps);
            }