Exemplo n.º 1
0
        public ContractBuilder(Type[] contractMessagesTypes, string contractAddress)
        {
            var abiExtractor = new AttributesToABIExtractor();

            ContractABI = abiExtractor.ExtractContractABI(contractMessagesTypes);
            Address     = contractAddress;
        }
Exemplo n.º 2
0
        public Contract(EthApiService eth, Type[] contractMessagesTypes, string contractAddress)
        {
            Eth          = eth;
            DefaultBlock = eth.DefaultBlock;
            var abiExtractor = new AttributesToABIExtractor();

            ContractBuilder = new ContractBuilder(contractMessagesTypes, contractAddress);
        }
Exemplo n.º 3
0
        public void ShouldExtractComplexTuples()
        {
            var abiLineItem      = "tuple(uint256 id, uint256 productId, uint256 quantity, string description)";
            var abiPurchaseOrder = $"tuple(uint256 id,{abiLineItem}[] lineItem, uint256 customerId)";
            var abi               = $@"function SetPurchaseOrders({abiPurchaseOrder}[] purchaseOrder) public";
            var contractAbi       = ABIDeserialiserFactory.DeserialiseContractABI(abi);
            var stringSignature   = contractAbi.Functions[0].Sha3Signature;
            var functionAbi       = new AttributesToABIExtractor().ExtractFunctionABI(typeof(SetPurchaseOrdersFunction));
            var expectedSignature = functionAbi.Sha3Signature;

            Assert.Equal(expectedSignature, stringSignature);
        }
Exemplo n.º 4
0
 public ParametersEncoder()
 {
     intTypeEncoder           = new IntTypeEncoder();
     attributesToABIExtractor = new AttributesToABIExtractor();
 }
Exemplo n.º 5
0
 public ParameterDecoder()
 {
     attributesToABIExtractor = new AttributesToABIExtractor();
 }
Exemplo n.º 6
0
 public ArrayTypeDecoder(ABIType elementType, int size)
 {
     Size        = size;
     ElementType = elementType;
     _attributesToABIExtractor = new AttributesToABIExtractor();
 }