Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Oct 4, 2022
1 parent c8531ea commit 24f0867
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions rskj-core/src/test/java/co/rsk/peg/BridgeSupportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,13 @@ public void voteFeePerKbChange_unsuccessfulVote_negativeFeePerKb() {
Transaction tx = mock(Transaction.class);
BridgeConstants constants = mock(BridgeConstants.class);
AddressBasedAuthorizer authorizer = mock(AddressBasedAuthorizer.class);
byte[] senderBytes = ByteUtil.leftPadBytes(new byte[]{0x43}, 20);

when(provider.getFeePerKbElection(any()))
.thenReturn(new ABICallElection(authorizer));
when(tx.getSender())
.thenReturn(new RskAddress(senderBytes));
when(constants.getFeePerKbChangeAuthorizer())
.thenReturn(authorizer);
when(authorizer.isAuthorized(eq(tx), any()))
.thenReturn(true);
when(authorizer.isAuthorized(tx.getSender()))
.thenReturn(true);
when(authorizer.getRequiredAuthorizedKeys())
.thenReturn(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ public class TxPoolModuleImplTest {
private TxPoolModule txPoolModule;
private TransactionPool transactionPool;
private Map<Integer, Account> accountMap;
private SignatureCache signatureCache;

@Before
public void setup() {
signatureCache = new ReceivedTxSignatureCache();
transactionPool = Web3Mocks.getMockTransactionPool();
txPoolModule = new TxPoolModuleImpl(transactionPool, signatureCache);
accountMap = new HashMap();
txPoolModule = new TxPoolModuleImpl(transactionPool, new ReceivedTxSignatureCache());
accountMap = new HashMap<>();
}

private Transaction createSampleTransaction() {
Expand Down

0 comments on commit 24f0867

Please sign in to comment.