Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Nc 1145 Acceptance test for getTransactionReceipt JSON-RPC method #278

Merged
merged 20 commits into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1ff064a
EthGetTransactionReceipt Acceptance test added
Shinabyss Nov 4, 2018
2146a6a
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
Shinabyss Nov 4, 2018
ef0db70
GetTransactionReceipt Acceptance Test updated to conform to new dsl
Shinabyss Nov 4, 2018
85d70a3
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
Shinabyss Nov 18, 2018
7c46e78
Update to new dsl
Shinabyss Nov 18, 2018
984dd7d
Update to new dsl
Shinabyss Nov 19, 2018
5f9135b
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
Shinabyss Nov 19, 2018
a3ec974
Update to new dsl - spotless applied
Shinabyss Nov 19, 2018
4549355
Naming convention corrected
Shinabyss Nov 20, 2018
8f1193d
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
Shinabyss Nov 20, 2018
90ffc61
Naming convention corrected
Shinabyss Nov 20, 2018
e404973
Naming convention corrected
Shinabyss Nov 20, 2018
4929caf
Merge remote-tracking branch 'origin/NC-1145' into NC-1145
Shinabyss Nov 20, 2018
1a581a4
Merge branch 'master' into NC-1145
Shinabyss Nov 20, 2018
41c6026
Naming convention corrected
Shinabyss Nov 20, 2018
b4c1054
Removed sender field to make test more efficient
Shinabyss Nov 20, 2018
e07ef34
Merge branch 'master' of https://github.com/PegaSysEng/pantheon into …
Shinabyss Nov 20, 2018
01f3339
Merge remote-tracking branch 'origin/NC-1145' into NC-1145
Shinabyss Nov 20, 2018
d0653fc
Removed sender field to make test more efficient
Shinabyss Nov 20, 2018
42beaf4
Merge branch 'master' into NC-1145
Shinabyss Nov 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Naming convention corrected
Deleted obsolete test cases
added assertion for status code
  • Loading branch information
Shinabyss committed Nov 20, 2018
commit 90ffc61ca3f36dc7c24716fb21387ecc7d52c9de
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public ExpectEthGetTransactionReceiptIsPresent(
public void verify(final Node node) {
final Optional<TransactionReceipt> response = node.execute(transaction);
assertThat(response.isPresent()).isTrue();
assertThat(response.get().getStatus()).isEqualToIgnoringCase("0x1");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public Condition accountsExceptional(final String expectedMessage) {
return new ExpectEthAccountsException(transactions.accounts(), expectedMessage);
}

public Condition getTransactionReceipt(final Hash transactionHash) {
public Condition expectTransactionReceipt(final Hash transactionHash) {
return new ExpectEthGetTransactionReceiptIsPresent(
transactions.getTransactionReceipt(transactionHash.toString()));
}

public Condition getTransactionReceiptNotAvailable(final String transactionHash) {
public Condition expectNoTransactionReceipt(final String transactionHash) {
return new ExpectEthGetTransactionReceiptIsAbsent(
transactions.getTransactionReceipt(transactionHash));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,17 @@ public void setUp() throws Exception {
}

@Test
public void mustCorrectlyQueryTransactionReceiptFromContractCreationTransaction() {
final Hash transactionHash = minerNode.execute(transactions.createTransfer(recipient, 5));
cluster.verify(recipient.balanceEquals(5));
minerNode.verify(eth.getTransactionReceipt(transactionHash));
}

@Test
public void mustCorrectlyQueryTransactionReceiptFromNormalTransaction() {
public void transactionMustHaveReceipt() {
final Hash transactionHash =
minerNode.execute(transactions.createTransfer(sender, recipient, 5));
cluster.verify(recipient.balanceEquals(5));
minerNode.verify(eth.getTransactionReceipt(transactionHash));
minerNode.verify(eth.expectTransactionReceipt(transactionHash));
}

@Test
public void mustReturnNullWhenTransactionDoesNotExist() {
public void mustHaveNoTransactionReceiptForImaginaryTransaction() {
minerNode.verify(
eth.getTransactionReceiptNotAvailable(
eth.expectNoTransactionReceipt(
"0x0000000000000000000000000000000000000000000000000000000000000000"));
}
}