Skip to content

Commit

Permalink
java: set proper length on ByteBuffer returned by Host in tests
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
  • Loading branch information
atoulme and axic committed Oct 9, 2020
1 parent 384f467 commit 0e15954
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public boolean accountExists(byte[] address) {

@Override
public ByteBuffer getStorage(byte[] address, byte[] key) {
return ByteBuffer.allocateDirect(64).put(new byte[64]);
return ByteBuffer.allocateDirect(32).put(new byte[32]);
}

@Override
Expand All @@ -23,7 +23,7 @@ public int setStorage(byte[] address, byte[] key, byte[] value) {

@Override
public ByteBuffer getBalance(byte[] address) {
return ByteBuffer.allocateDirect(64).put(new byte[64]);
return ByteBuffer.allocateDirect(32).put(new byte[32]);
}

@Override
Expand All @@ -33,7 +33,7 @@ public int getCodeSize(byte[] address) {

@Override
public ByteBuffer getCodeHash(byte[] address) {
return ByteBuffer.allocateDirect(64).put(new byte[64]);
return ByteBuffer.allocateDirect(32).put(new byte[32]);
}

@Override
Expand All @@ -51,12 +51,12 @@ public ByteBuffer call(ByteBuffer msg) {

@Override
public ByteBuffer getTxContext() {
return ByteBuffer.allocateDirect(64).put(new byte[64]);
return ByteBuffer.allocateDirect(160).put(new byte[160]);
}

@Override
public ByteBuffer getBlockHash(long number) {
return ByteBuffer.allocateDirect(64).put(new byte[64]);
return ByteBuffer.allocateDirect(32).put(new byte[32]);
}

@Override
Expand Down

0 comments on commit 0e15954

Please sign in to comment.