-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty wallet created when querying transactions on v1 #1949
Comments
boiled it down to senderId, as running the above queries without it doesn't seem to respond with the template model |
|
public findByAddress(address) {
if (!this.byAddress[address]) {
this.byAddress[address] = new Wallet(address);
}
return this.byAddress[address];
} Then on subsequent round would not create a new wallet, but return the newly created wallet? Btw, this is definitely cached behaviour as I tried with the address you provided and is was |
after running the second command but only with senderId, the third command indeed returns a {
"account": {
"address": "DLWeBuwSBFYtUFj8kFB8CFswfvN2ht3yKn",
"publicKey": null,
"secondPublicKey": null,
"username": null,
"balance": "0",
"unconfirmedBalance": "0",
"multisignatures": [],
"u_multisignatures": [],
"unconfirmedSignature": 0,
"secondSignature": 0
},
"success": true
} |
So, from what I can tell: querying legacy with senderId triggers the creation of a Wallet object in this.byAddress of core-database/wallet-manager set to a default. Then, a query to accounts?address=COLD will database.wallets.findById() it and return the empty object, but not before transforming it to fit the v1 spec. I could be miles off in any of these statements, this is some preliminary detective work for the team. |
I will not be fixing this today. |
- When querying for /accounts?address, return error if account.publicKey === null (cold wallet) - Add test to check for bug Ref: ArkEcosystem#1949
Describe the bug
When querying the v1
/api/transactions
endpoint, it creates an empty wallet. I have not tested on v2 endpointsTo Reproduce
Steps to reproduce the behavior:
https://dexplorer.ark.io:8443/api/accounts?address=<COLD_WALLET_ADDRESS>
- it will return "Account not found"https://dexplorer.ark.io:8443/api/transactions?recipientId=<COLD_WALLET_ADDRESS>&senderId=<COLD_WALLET_ADDRESS>&orderBy=timestamp:desc&offset=0&limit=50
https://dexplorer.ark.io:8443/api/accounts?address=<COLD_WALLET_ADDRESS>
- it will return a cold wallet object response (see below)Expected behavior
The wallet should return "Account not found" still
The text was updated successfully, but these errors were encountered: