Comments (8)
I think this is potentially user error
which hash256 algorithm are you using? you should be using
HASH_ALGORITHM = "BLAKE2B-256";
from semux-core.
in your code you aren't signing the transaction...
you need to sign it before verifying :D
I was able to successfully validate this with both Native and non native implementations. So it looks like if you sign the tx, it validates.
from semux-core.
Please try running
byte[] msg = Bytes.random(100);
byte[] hash = Hash.h256(msg);
byte[] nativeHash = Native.h256(msg);
System.out.println(Arrays.equals(hash,nativeHash));
and let me know what it prints
from semux-core.
Is this mobile/android? Yea, you might want to call Native.disable() when your program starts up.
It's weird that the native call executes without error... I'm not sure if JNI calls work on android, or if we need to compile for that platform, but using Native.disable() should help you.
from semux-core.
I disabled native completely.
I am using Blake2b-256 .. but i will check that.
I sign the tx... Without signing the error message is: not a correct hex string
So its simply signing wrong...
I will check fir blake- iirc it is set to default like in semux.
Pending mgr would accept a signed msg from own wallet- uses the same Algorithm for sig and validate...
from semux-core.
I believe we have compatibility tests between the native and Java BLAKE2b implementation. @phash please update this ticket if get more findings.
from semux-core.
Was running the following unit test, and get consistent behavior with/out native impl.
@Test
public void testCompatibility() {
String raw = "0x00031409c5f2794d69717d538bfcc150644f7685945cfa00000002540be40000000000004c4b40000000000000000100000165c4f4f54700";
Transaction tx = Transaction.fromEncoded(Hex.decode0x(raw));
System.out.println(tx.validate(Network.MAINNET));
Native.disable();
System.out.println(tx.validate(Network.MAINNET));
}
from semux-core.
Imho, this seems to be my fault... damn... Strings... it was blake2s instead of blake2b...
from semux-core.
Related Issues (20)
- estimate-gas returns 0 HOT 1
- estimate-gas return wrong value HOT 3
- Add ed25519 precompiled contract
- Does it support erc20 contract HOT 1
- Which version of the code will work?
- Could you provide a tutorial on building a private chain please? HOT 9
- Encode error HOT 1
- Synchronize the evm changes in go-ethereum to Semux HOT 5
- Add an interface to query the contract data of the local node. HOT 1
- Сhecksum for imported mnemonic phrase is not verified HOT 1
- has not check commitVotes HOT 7
- Why does semuxRepository. rollback() call DelegateState.commit(), which I think should call DelegateState.rollback() HOT 1
- Deprecate GUI in favor of web wallet
- Wallet is not starting on macOS Big Sur
- Show transaction failure details
- Why does Semux need the function PendingManager.processTransaction() ? HOT 12
- Add option for specifying # digits after decimal point
- Wallet is not starting on windows HOT 4
- semux-gui not loading on MacOS Big Sur HOT 2
- java.lang.RuntimeException: Could not generate model 'AccountType' at io.swagger.codegen.v3.DefaultGenerator.generateModels
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semux-core.