Пример #1
0
        public async ValueTask <(Keccak, AcceptTxResult?)> SendTransaction(Transaction tx, TxHandlingOptions txHandlingOptions)
        {
            await EnsureAccount();

            ProvideTx provideTx = new ProvideTx();

            provideTx.Data        = tx.Data?.ToHexString(true);
            provideTx.Description = "From Nethermind with love";
            provideTx.Hash        = tx.Hash?.ToString();
            provideTx.AccountId   = _accountId;
            provideTx.NetworkId   = _networkId;
            provideTx.To          = tx.To?.ToString();
            provideTx.Value       = (BigInteger)tx.Value;
            provideTx.Params      = new string[] { "subsidize", "true" };
            // this should happen after we set the GasPrice
            _txSigner.Seal(tx, TxHandlingOptions.None);
            ProvideTx createdTx = await _provide.CreateTransaction(provideTx);

            return(createdTx?.Hash == null ? Keccak.Zero : new Keccak(createdTx.Hash), null);
        }
Пример #2
0
        public async ValueTask <Keccak> SendTransaction(Transaction tx, TxHandlingOptions txHandlingOptions)
        {
            ProvideTx provideTx = new ProvideTx();

            provideTx.Data        = (tx.Data ?? tx.Init).ToHexString();
            provideTx.Description = "From Nethermind with love";
            provideTx.Hash        = tx.Hash.ToString();
            provideTx.Signer      = tx.SenderAddress.ToString();
            provideTx.NetworkId   = _networkId;
            provideTx.To          = tx.To.ToString();
            provideTx.Value       = (BigInteger)tx.Value;
            provideTx.Params      = new Dictionary <string, object>
            {
                { "subsidize", true }
            };

            // this should happen after we set the GasPrice
            _txSigner.Seal(tx);

            ProvideTx createdTx = await _provide.CreateTransaction(provideTx);

            return(new Keccak(createdTx.Hash));
        }
Пример #3
0
        public async ValueTask <Keccak> SendTransaction(Transaction tx, TxHandlingOptions txHandlingOptions)
        {
            await EnsureAccount();

            ProvideTx provideTx = new ProvideTx();

            provideTx.Data        = "0x" + (tx.Data ?? tx.Init).ToHexString();
            provideTx.Description = "From Nethermind with love";
            provideTx.Hash        = tx.Hash?.ToString();
            provideTx.AccountId   = _accountId;
            provideTx.NetworkId   = _networkId;
            provideTx.To          = tx.To?.ToString();
            provideTx.Value       = (BigInteger)tx.Value;
            provideTx.Params      = new Dictionary <string, object>
            {
                { "subsidize", true },
            };
            // this should happen after we set the GasPrice
            _txSigner.Seal(tx, TxHandlingOptions.None);
            ProvideTx createdTx = await _provide.CreateTransaction(provideTx);

            return(createdTx?.Hash == null ? Keccak.Zero : new Keccak(createdTx.Hash));
        }