diff --git a/codegen/src/test/resources/solidity/shipit/build/ShipIt.bin b/codegen/src/test/resources/solidity/shipit/build/ShipIt.bin index 5f02f9f59..4dda2726c 100644 --- a/codegen/src/test/resources/solidity/shipit/build/ShipIt.bin +++ b/codegen/src/test/resources/solidity/shipit/build/ShipIt.bin @@ -1 +1 @@ -6060604052341561000f57600080fd5b6101e48061001e6000396000f3006060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d51cd4ac8114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff60043516610159565b60405173ffffffffffffffffffffffffffffffffffffffff808a168252881660208201526040810187905260608101869052608081018560008111156100b357fe5b60ff168152602081018590526060810183905260808282038101604083019081528554600260001960018316156101000201909116049183018290529160a00190859080156101435780601f1061011857610100808354040283529160200191610143565b820191906000526020600020905b81548152906001019060200180831161012657829003601f168201915b5050995050505050505050505060405180910390f35b6000602081905290815260409020805460018201546002830154600384015460048501546005860154600787015473ffffffffffffffffffffffffffffffffffffffff9687169796909516959394929360ff90921692909160060190885600a165627a7a72305820f4d4bf1c9ea57666a0a0e3a810321535fee9dd5f0809158d2f27a18e0a2df2560029 \ No newline at end of file +6060604052341561000f57600080fd5b6101e48061001e6000396000f3006060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d51cd4ac8114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff60043516610159565b60405173ffffffffffffffffffffffffffffffffffffffff808a168252881660208201526040810187905260608101869052608081018560008111156100b357fe5b60ff168152602081018590526060810183905260808282038101604083019081528554600260001960018316156101000201909116049183018290529160a00190859080156101435780601f1061011857610100808354040283529160200191610143565b820191906000526020600020905b81548152906001019060200180831161012657829003601f168201915b5050995050505050505050505060405180910390f35b6000602081905290815260409020805460018201546002830154600384015460048501546005860154600787015473ffffffffffffffffffffffffffffffffffffffff9687169796909516959394929360ff90921692909160060190885600a165627a7a723058200d498cd38cd8aaf532d9d54719f0f05c4865f5197a27c90e9dbdabb6f87524c60029 \ No newline at end of file diff --git a/crypto/src/main/java/org/web3j/crypto/Sign.java b/crypto/src/main/java/org/web3j/crypto/Sign.java index ceb940478..1c0da0079 100644 --- a/crypto/src/main/java/org/web3j/crypto/Sign.java +++ b/crypto/src/main/java/org/web3j/crypto/Sign.java @@ -108,7 +108,7 @@ private static BigInteger recoverFromSignature(int recId, ECDSASignature sig, by BigInteger i = BigInteger.valueOf((long) recId / 2); BigInteger x = sig.r.add(i.multiply(n)); // 1.2. Convert the integer x to an octet string X of length mlen using the conversion - // routine specified in Section 2.3.7, where mlen = ⌈(log2 p)/8⌉ or mlen = ⌈m/8⌉. + // routine specified in Section 2.3.7, where mlen = (log2 p)/8 or mlen = m/8. // 1.3. Convert the octet string (16 set binary digits)||X to an elliptic curve point R // using the conversion routine specified in Section 2.3.4. If this conversion // routine outputs "invalid", then do another iteration of Step 1. diff --git a/integration-tests/src/test/java/org/web3j/generated/Arrays.java b/integration-tests/src/test/java/org/web3j/generated/Arrays.java index f2a548b1d..f8c57b18a 100644 --- a/integration-tests/src/test/java/org/web3j/generated/Arrays.java +++ b/integration-tests/src/test/java/org/web3j/generated/Arrays.java @@ -23,10 +23,10 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version none. + *

Generated with web3j version 3.3.1. */ public class Arrays extends Contract { - private static final String BINARY = "6060604052341561000f57600080fd5b6102da8061001e6000396000f3006060604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633cac14c8811461005b578063b96f54d1146100c1578063beda363b14610136575b600080fd5b341561006657600080fd5b61006e610185565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156100ad578082015183820152602001610095565b505050509050019250505060405180910390f35b34156100cc57600080fd5b6100fd600461014481600a6101406040519081016040529190828261014080828437509395506101b2945050505050565b604051808261014080838360005b8381101561012357808201518382015260200161010b565b5050505090500191505060405180910390f35b341561014157600080fd5b61006e60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506101fe95505050505050565b61018d610274565b600060405180591061019c5750595b9080825280602002602001820160405250905090565b6101ba610286565b600a60005b818110156101f7578360001982840301600a81106101d957fe5b60200201518382600a81106101ea57fe5b60200201526001016101bf565b5050919050565b610206610274565b600080835191508160405180591061021b5750595b90808252806020026020018201604052509250600090505b818110156101f757838160010183038151811061024c57fe5b9060200190602002015183828151811061026257fe5b60209081029091010152600101610233565b60206040519081016040526000815290565b610140604051908101604052600a815b600081526020019060019003908161029657905050905600a165627a7a72305820305df0b85cbf8cf9c0720830cf03914a3044a0459d83288859a24d3dd311ef840029"; + private static final String BINARY = "6060604052341561000f57600080fd5b6102da8061001e6000396000f3006060604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633cac14c8811461005b578063b96f54d1146100c1578063beda363b14610136575b600080fd5b341561006657600080fd5b61006e610185565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156100ad578082015183820152602001610095565b505050509050019250505060405180910390f35b34156100cc57600080fd5b6100fd600461014481600a6101406040519081016040529190828261014080828437509395506101b2945050505050565b604051808261014080838360005b8381101561012357808201518382015260200161010b565b5050505090500191505060405180910390f35b341561014157600080fd5b61006e60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506101fe95505050505050565b61018d610274565b600060405180591061019c5750595b9080825280602002602001820160405250905090565b6101ba610286565b600a60005b818110156101f7578360001982840301600a81106101d957fe5b60200201518382600a81106101ea57fe5b60200201526001016101bf565b5050919050565b610206610274565b600080835191508160405180591061021b5750595b90808252806020026020018201604052509250600090505b818110156101f757838160010183038151811061024c57fe5b9060200190602002015183828151811061026257fe5b60209081029091010152600101610233565b60206040519081016040526000815290565b610140604051908101604052600a815b600081526020019060019003908161029657905050905600a165627a7a7230582034918bda59986d00e23ee28f7dd5fb530d03592154847fc1e32548eaa9b5c28a0029"; protected Arrays(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); diff --git a/integration-tests/src/test/java/org/web3j/generated/Fibonacci.java b/integration-tests/src/test/java/org/web3j/generated/Fibonacci.java index 8091d9d8e..503e9f857 100644 --- a/integration-tests/src/test/java/org/web3j/generated/Fibonacci.java +++ b/integration-tests/src/test/java/org/web3j/generated/Fibonacci.java @@ -30,10 +30,15 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version 3.3.0. + *

Generated with web3j version 3.3.1. */ public class Fibonacci extends Contract { - private static final String BINARY = "6060604052341561000f57600080fd5b6101498061001e6000396000f30060606040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633c7fdc70811461005057806361047ff414610078575b600080fd5b341561005b57600080fd5b61006660043561008e565b60405190815260200160405180910390f35b341561008357600080fd5b6100666004356100da565b6000610099826100da565b90507f71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed828260405191825260208201526040908101905180910390a1919050565b60008115156100eb57506000610118565b81600114156100fc57506001610118565b610108600283036100da565b610114600184036100da565b0190505b9190505600a165627a7a72305820e408d0180959faf2f0168a105318c66ad9cee6a322569be9157dfc267cf450ce0029"; + private static final String BINARY = "6060604052341561000f57600080fd5b6101498061001e6000396000f30060606040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633c7fdc70811461005057806361047ff414610078575b600080fd5b341561005b57600080fd5b61006660043561008e565b60405190815260200160405180910390f35b341561008357600080fd5b6100666004356100da565b6000610099826100da565b90507f71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed828260405191825260208201526040908101905180910390a1919050565b60008115156100eb57506000610118565b81600114156100fc57506001610118565b610108600283036100da565b610114600184036100da565b0190505b9190505600a165627a7a72305820b79593e85095f5c09ecad21be0e9501a5528960f09cf22e8543ff6221976ea8e0029"; + + public static final Event NOTIFY_EVENT = new Event("Notify", + Arrays.>asList(), + Arrays.>asList(new TypeReference() {}, new TypeReference() {})); + ; protected Fibonacci(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); @@ -44,10 +49,7 @@ protected Fibonacci(String contractAddress, Web3j web3j, TransactionManager tran } public List getNotifyEvents(TransactionReceipt transactionReceipt) { - final Event event = new Event("Notify", - Arrays.>asList(), - Arrays.>asList(new TypeReference() {}, new TypeReference() {})); - List valueList = extractEventParametersWithLog(event, transactionReceipt); + List valueList = extractEventParametersWithLog(NOTIFY_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { NotifyEventResponse typedResponse = new NotifyEventResponse(); @@ -59,16 +61,11 @@ public List getNotifyEvents(TransactionReceipt transactionR return responses; } - public Observable notifyEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - final Event event = new Event("Notify", - Arrays.>asList(), - Arrays.>asList(new TypeReference() {}, new TypeReference() {})); - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(event)); + public Observable notifyEventObservable(EthFilter filter) { return web3j.ethLogObservable(filter).map(new Func1() { @Override public NotifyEventResponse call(Log log) { - Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(event, log); + Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(NOTIFY_EVENT, log); NotifyEventResponse typedResponse = new NotifyEventResponse(); typedResponse.log = log; typedResponse.input = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -78,8 +75,14 @@ public NotifyEventResponse call(Log log) { }); } + public Observable notifyEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(NOTIFY_EVENT)); + return notifyEventObservable(filter); + } + public RemoteCall fibonacciNotify(BigInteger number) { - Function function = new Function( + final Function function = new Function( "fibonacciNotify", Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(number)), Collections.>emptyList()); @@ -87,7 +90,7 @@ public RemoteCall fibonacciNotify(BigInteger number) { } public RemoteCall fibonacci(BigInteger number) { - Function function = new Function("fibonacci", + final Function function = new Function("fibonacci", Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(number)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); diff --git a/integration-tests/src/test/java/org/web3j/generated/Greeter.java b/integration-tests/src/test/java/org/web3j/generated/Greeter.java index 796f6a3d5..fe0f5048a 100644 --- a/integration-tests/src/test/java/org/web3j/generated/Greeter.java +++ b/integration-tests/src/test/java/org/web3j/generated/Greeter.java @@ -22,7 +22,7 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version 3.3.0. + *

Generated with web3j version 3.3.1. */ public class Greeter extends Contract { private static final String BINARY = "6060604052341561000f57600080fd5b6040516103203803806103208339810160405280805160008054600160a060020a03191633600160a060020a03161790559190910190506001818051610059929160200190610060565b50506100fb565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a157805160ff19168380011785556100ce565b828001600101855582156100ce579182015b828111156100ce5782518255916020019190600101906100b3565b506100da9291506100de565b5090565b6100f891905b808211156100da57600081556001016100e4565b90565b6102168061010a6000396000f30060606040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b58114610050578063cfae321714610065575b600080fd5b341561005b57600080fd5b6100636100ef565b005b341561007057600080fd5b610078610130565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100b457808201518382015260200161009c565b50505050905090810190601f1680156100e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000543373ffffffffffffffffffffffffffffffffffffffff9081169116141561012e5760005473ffffffffffffffffffffffffffffffffffffffff16ff5b565b6101386101d8565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101ce5780601f106101a3576101008083540402835291602001916101ce565b820191906000526020600020905b8154815290600101906020018083116101b157829003601f168201915b5050505050905090565b602060405190810160405260008152905600a165627a7a723058201469caa2b23472d9b36058510d9fe408d2f0fe25be907003efc4526c335641f20029"; @@ -36,7 +36,7 @@ protected Greeter(String contractAddress, Web3j web3j, TransactionManager transa } public RemoteCall kill() { - Function function = new Function( + final Function function = new Function( "kill", Arrays.asList(), Collections.>emptyList()); @@ -44,7 +44,7 @@ public RemoteCall kill() { } public RemoteCall greet() { - Function function = new Function("greet", + final Function function = new Function("greet", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); diff --git a/integration-tests/src/test/java/org/web3j/generated/HumanStandardToken.java b/integration-tests/src/test/java/org/web3j/generated/HumanStandardToken.java index e04e1ea12..30d5e1ae1 100644 --- a/integration-tests/src/test/java/org/web3j/generated/HumanStandardToken.java +++ b/integration-tests/src/test/java/org/web3j/generated/HumanStandardToken.java @@ -34,10 +34,20 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version 3.3.0. + *

Generated with web3j version 3.3.1. */ public class HumanStandardToken extends Contract { - private static final String BINARY = "606060405260408051908101604052600481527f48302e31000000000000000000000000000000000000000000000000000000006020820152600690805161004b9291602001906100e7565b50341561005757600080fd5b6040516109fa3803806109fa833981016040528080519190602001805182019190602001805191906020018051600160a060020a0333166000908152600160205260408120879055869055909101905060038380516100ba9291602001906100e7565b506004805460ff191660ff841617905560058180516100dd9291602001906100e7565b5050505050610182565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061012857805160ff1916838001178555610155565b82800160010185558215610155579182015b8281111561015557825182559160200191906001019061013a565b50610161929150610165565b5090565b61017f91905b80821115610161576000815560010161016b565b90565b610869806101916000396000f3006060604052600436106100955763ffffffff60e060020a60003504166306fdde0381146100a5578063095ea7b31461012f57806318160ddd1461016557806323b872dd1461018a578063313ce567146101b257806354fd4d50146101db57806370a08231146101ee57806395d89b411461020d578063a9059cbb14610220578063cae9ca5114610242578063dd62ed3e146102a7575b34156100a057600080fd5b600080fd5b34156100b057600080fd5b6100b86102cc565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f45780820151838201526020016100dc565b50505050905090810190601f1680156101215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013a57600080fd5b610151600160a060020a036004351660243561036a565b604051901515815260200160405180910390f35b341561017057600080fd5b6101786103d7565b60405190815260200160405180910390f35b341561019557600080fd5b610151600160a060020a03600435811690602435166044356103dd565b34156101bd57600080fd5b6101c56104d5565b60405160ff909116815260200160405180910390f35b34156101e657600080fd5b6100b86104de565b34156101f957600080fd5b610178600160a060020a0360043516610549565b341561021857600080fd5b6100b8610564565b341561022b57600080fd5b610151600160a060020a03600435166024356105cf565b341561024d57600080fd5b61015160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061067295505050505050565b34156102b257600080fd5b610178600160a060020a0360043581169060243516610812565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b820191906000526020600020905b81548152906001019060200180831161034557829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a03831660009081526001602052604081205482901080159061042d5750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b80156104395750600082115b156104ca57600160a060020a03808416600081815260016020908152604080832080548801905588851680845281842080548990039055600283528184203390961684529490915290819020805486900390559091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016104ce565b5060005b9392505050565b60045460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b600160a060020a031660009081526001602052604090205490565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b600160a060020a0333166000908152600160205260408120548290108015906105f85750600082115b1561066a57600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016103d1565b5060006103d1565b600160a060020a03338116600081815260026020908152604080832094881680845294909152808220869055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a383600160a060020a03166040517f72656365697665417070726f76616c28616464726573732c75696e743235362c81527f616464726573732c6279746573290000000000000000000000000000000000006020820152602e01604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b838110156107b357808201518382015260200161079b565b50505050905090810190601f1680156107e05780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f192505050151561080857600080fd5b5060019392505050565b600160a060020a039182166000908152600260209081526040808320939094168252919091522054905600a165627a7a72305820f7c827ed01d6c3a0eb10c6ab62e5e5ada68884ce0920c089c8917225b61f2a6d0029"; + private static final String BINARY = "606060405260408051908101604052600481527f48302e31000000000000000000000000000000000000000000000000000000006020820152600690805161004b9291602001906100e7565b50341561005757600080fd5b6040516109fa3803806109fa833981016040528080519190602001805182019190602001805191906020018051600160a060020a0333166000908152600160205260408120879055869055909101905060038380516100ba9291602001906100e7565b506004805460ff191660ff841617905560058180516100dd9291602001906100e7565b5050505050610182565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061012857805160ff1916838001178555610155565b82800160010185558215610155579182015b8281111561015557825182559160200191906001019061013a565b50610161929150610165565b5090565b61017f91905b80821115610161576000815560010161016b565b90565b610869806101916000396000f3006060604052600436106100955763ffffffff60e060020a60003504166306fdde0381146100a5578063095ea7b31461012f57806318160ddd1461016557806323b872dd1461018a578063313ce567146101b257806354fd4d50146101db57806370a08231146101ee57806395d89b411461020d578063a9059cbb14610220578063cae9ca5114610242578063dd62ed3e146102a7575b34156100a057600080fd5b600080fd5b34156100b057600080fd5b6100b86102cc565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f45780820151838201526020016100dc565b50505050905090810190601f1680156101215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013a57600080fd5b610151600160a060020a036004351660243561036a565b604051901515815260200160405180910390f35b341561017057600080fd5b6101786103d7565b60405190815260200160405180910390f35b341561019557600080fd5b610151600160a060020a03600435811690602435166044356103dd565b34156101bd57600080fd5b6101c56104d5565b60405160ff909116815260200160405180910390f35b34156101e657600080fd5b6100b86104de565b34156101f957600080fd5b610178600160a060020a0360043516610549565b341561021857600080fd5b6100b8610564565b341561022b57600080fd5b610151600160a060020a03600435166024356105cf565b341561024d57600080fd5b61015160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061067295505050505050565b34156102b257600080fd5b610178600160a060020a0360043581169060243516610812565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b820191906000526020600020905b81548152906001019060200180831161034557829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a03831660009081526001602052604081205482901080159061042d5750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b80156104395750600082115b156104ca57600160a060020a03808416600081815260016020908152604080832080548801905588851680845281842080548990039055600283528184203390961684529490915290819020805486900390559091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016104ce565b5060005b9392505050565b60045460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b600160a060020a031660009081526001602052604090205490565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103625780601f1061033757610100808354040283529160200191610362565b600160a060020a0333166000908152600160205260408120548290108015906105f85750600082115b1561066a57600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016103d1565b5060006103d1565b600160a060020a03338116600081815260026020908152604080832094881680845294909152808220869055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a383600160a060020a03166040517f72656365697665417070726f76616c28616464726573732c75696e743235362c81527f616464726573732c6279746573290000000000000000000000000000000000006020820152602e01604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b838110156107b357808201518382015260200161079b565b50505050905090810190601f1680156107e05780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f192505050151561080857600080fd5b5060019392505050565b600160a060020a039182166000908152600260209081526040808320939094168252919091522054905600a165627a7a72305820157a6daf37d8e05e02039139656c677b7fa63b9f122b307e5d1c2af64f73f5dc0029"; + + public static final Event TRANSFER_EVENT = new Event("Transfer", + Arrays.>asList(new TypeReference

() {}, new TypeReference
() {}), + Arrays.>asList(new TypeReference() {})); + ; + + public static final Event APPROVAL_EVENT = new Event("Approval", + Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), + Arrays.>asList(new TypeReference() {})); + ; protected HumanStandardToken(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); @@ -48,10 +58,7 @@ protected HumanStandardToken(String contractAddress, Web3j web3j, TransactionMan } public List getTransferEvents(TransactionReceipt transactionReceipt) { - final Event event = new Event("Transfer", - Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), - Arrays.>asList(new TypeReference() {})); - List valueList = extractEventParametersWithLog(event, transactionReceipt); + List valueList = extractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { TransferEventResponse typedResponse = new TransferEventResponse(); @@ -64,16 +71,11 @@ public List getTransferEvents(TransactionReceipt transact return responses; } - public Observable transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - final Event event = new Event("Transfer", - Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), - Arrays.>asList(new TypeReference() {})); - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(event)); + public Observable transferEventObservable(EthFilter filter) { return web3j.ethLogObservable(filter).map(new Func1() { @Override public TransferEventResponse call(Log log) { - Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(event, log); + Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log); TransferEventResponse typedResponse = new TransferEventResponse(); typedResponse.log = log; typedResponse._from = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -84,11 +86,14 @@ public TransferEventResponse call(Log log) { }); } + public Observable transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); + return transferEventObservable(filter); + } + public List getApprovalEvents(TransactionReceipt transactionReceipt) { - final Event event = new Event("Approval", - Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), - Arrays.>asList(new TypeReference() {})); - List valueList = extractEventParametersWithLog(event, transactionReceipt); + List valueList = extractEventParametersWithLog(APPROVAL_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { ApprovalEventResponse typedResponse = new ApprovalEventResponse(); @@ -101,16 +106,11 @@ public List getApprovalEvents(TransactionReceipt transact return responses; } - public Observable approvalEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - final Event event = new Event("Approval", - Arrays.>asList(new TypeReference
() {}, new TypeReference
() {}), - Arrays.>asList(new TypeReference() {})); - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(event)); + public Observable approvalEventObservable(EthFilter filter) { return web3j.ethLogObservable(filter).map(new Func1() { @Override public ApprovalEventResponse call(Log log) { - Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(event, log); + Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVAL_EVENT, log); ApprovalEventResponse typedResponse = new ApprovalEventResponse(); typedResponse.log = log; typedResponse._owner = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -121,15 +121,21 @@ public ApprovalEventResponse call(Log log) { }); } + public Observable approvalEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT)); + return approvalEventObservable(filter); + } + public RemoteCall name() { - Function function = new Function("name", + final Function function = new Function("name", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteCall approve(String _spender, BigInteger _value) { - Function function = new Function( + final Function function = new Function( "approve", Arrays.asList(new org.web3j.abi.datatypes.Address(_spender), new org.web3j.abi.datatypes.generated.Uint256(_value)), @@ -138,14 +144,14 @@ public RemoteCall approve(String _spender, BigInteger _value } public RemoteCall totalSupply() { - Function function = new Function("totalSupply", + final Function function = new Function("totalSupply", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteCall transferFrom(String _from, String _to, BigInteger _value) { - Function function = new Function( + final Function function = new Function( "transferFrom", Arrays.asList(new org.web3j.abi.datatypes.Address(_from), new org.web3j.abi.datatypes.Address(_to), @@ -155,35 +161,35 @@ public RemoteCall transferFrom(String _from, String _to, Big } public RemoteCall decimals() { - Function function = new Function("decimals", + final Function function = new Function("decimals", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteCall version() { - Function function = new Function("version", + final Function function = new Function("version", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteCall balanceOf(String _owner) { - Function function = new Function("balanceOf", + final Function function = new Function("balanceOf", Arrays.asList(new org.web3j.abi.datatypes.Address(_owner)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteCall symbol() { - Function function = new Function("symbol", + final Function function = new Function("symbol", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteCall transfer(String _to, BigInteger _value) { - Function function = new Function( + final Function function = new Function( "transfer", Arrays.asList(new org.web3j.abi.datatypes.Address(_to), new org.web3j.abi.datatypes.generated.Uint256(_value)), @@ -192,7 +198,7 @@ public RemoteCall transfer(String _to, BigInteger _value) { } public RemoteCall approveAndCall(String _spender, BigInteger _value, byte[] _extraData) { - Function function = new Function( + final Function function = new Function( "approveAndCall", Arrays.asList(new org.web3j.abi.datatypes.Address(_spender), new org.web3j.abi.datatypes.generated.Uint256(_value), @@ -202,7 +208,7 @@ public RemoteCall approveAndCall(String _spender, BigInteger } public RemoteCall allowance(String _owner, String _spender) { - Function function = new Function("allowance", + final Function function = new Function("allowance", Arrays.asList(new org.web3j.abi.datatypes.Address(_owner), new org.web3j.abi.datatypes.Address(_spender)), Arrays.>asList(new TypeReference() {})); diff --git a/integration-tests/src/test/java/org/web3j/generated/ShipIt.java b/integration-tests/src/test/java/org/web3j/generated/ShipIt.java index 4c6e95afb..e2c8f2b75 100644 --- a/integration-tests/src/test/java/org/web3j/generated/ShipIt.java +++ b/integration-tests/src/test/java/org/web3j/generated/ShipIt.java @@ -26,10 +26,10 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version 3.3.0. + *

Generated with web3j version 3.3.1. */ public class ShipIt extends Contract { - private static final String BINARY = "6060604052341561000f57600080fd5b6101e48061001e6000396000f3006060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d51cd4ac8114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff60043516610159565b60405173ffffffffffffffffffffffffffffffffffffffff808a168252881660208201526040810187905260608101869052608081018560008111156100b357fe5b60ff168152602081018590526060810183905260808282038101604083019081528554600260001960018316156101000201909116049183018290529160a00190859080156101435780601f1061011857610100808354040283529160200191610143565b820191906000526020600020905b81548152906001019060200180831161012657829003601f168201915b5050995050505050505050505060405180910390f35b6000602081905290815260409020805460018201546002830154600384015460048501546005860154600787015473ffffffffffffffffffffffffffffffffffffffff9687169796909516959394929360ff90921692909160060190885600a165627a7a72305820f4d4bf1c9ea57666a0a0e3a810321535fee9dd5f0809158d2f27a18e0a2df2560029"; + private static final String BINARY = "6060604052341561000f57600080fd5b6101e48061001e6000396000f3006060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d51cd4ac8114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff60043516610159565b60405173ffffffffffffffffffffffffffffffffffffffff808a168252881660208201526040810187905260608101869052608081018560008111156100b357fe5b60ff168152602081018590526060810183905260808282038101604083019081528554600260001960018316156101000201909116049183018290529160a00190859080156101435780601f1061011857610100808354040283529160200191610143565b820191906000526020600020905b81548152906001019060200180831161012657829003601f168201915b5050995050505050505050505060405180910390f35b6000602081905290815260409020805460018201546002830154600384015460048501546005860154600787015473ffffffffffffffffffffffffffffffffffffffff9687169796909516959394929360ff90921692909160060190885600a165627a7a723058200d498cd38cd8aaf532d9d54719f0f05c4865f5197a27c90e9dbdabb6f87524c60029"; protected ShipIt(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); diff --git a/integration-tests/src/test/java/org/web3j/generated/SimpleStorage.java b/integration-tests/src/test/java/org/web3j/generated/SimpleStorage.java index 408a4b47a..2a1e98363 100644 --- a/integration-tests/src/test/java/org/web3j/generated/SimpleStorage.java +++ b/integration-tests/src/test/java/org/web3j/generated/SimpleStorage.java @@ -21,7 +21,7 @@ * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * - *

Generated with web3j version 3.3.0. + *

Generated with web3j version 3.3.1. */ public class SimpleStorage extends Contract { private static final String BINARY = "6060604052341561000f57600080fd5b600560005560bb806100226000396000f30060606040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b18114604d5780636d4ce63c146062575b600080fd5b3415605757600080fd5b60606004356084565b005b3415606c57600080fd5b60726089565b60405190815260200160405180910390f35b600055565b600054905600a165627a7a72305820430774b8a91f549acbaaace2b6ac7d17f15706f8ac365056ab9775a9d20e1be40029"; @@ -35,7 +35,7 @@ protected SimpleStorage(String contractAddress, Web3j web3j, TransactionManager } public RemoteCall set(BigInteger x) { - Function function = new Function( + final Function function = new Function( "set", Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(x)), Collections.>emptyList()); @@ -43,7 +43,7 @@ public RemoteCall set(BigInteger x) { } public RemoteCall get() { - Function function = new Function("get", + final Function function = new Function("get", Arrays.asList(), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class);