Closed a1300 closed 6 years ago
Hi @a1300 thanks, you did a great job!
The the username
parameter is remove from the createDelegate
function at https://github.com/AschPlatform/asch-js/blob/6c1f7d0569484c18f48742ce27fd69b018d1e8e0/lib/transactions/delegate.js#L7.
On the other hand registerDelegate()
in asch-core
requires that the sender account has set a name already: https://github.com/AschPlatform/asch/blob/master/src/contract/basic.js#L330
As mention already at https://github.com/AschPlatform/asch/issues/246 is is not clear what is expected? Should the sender register / set a name first?
On the other hand
registerDelegate()
inasch-core
requires that the sender account has set a name already
@bassjobsen yes, exactly
The ASCH 1.4.x transaction API doesn't need the username to register as a delegate (because the username must be already set).
The older API (ASCH 1.3.6) needed the username to register as a delegate
@a1300 thanks for your quick reply:
The ASCH 1.4.x transaction API doesn't need the username to register as a delegate (because the username must be already set).
Okay thanks, that's clear. Now i wonder shouldn't asch-js throw a error when the user name is not set? Or do you expect asch-core should handle this?
@bassjobsen NP 😃
I think that the asch-js package isn't allowed to know if the username is set for an account (because it hasn't access to the database). asch-js is a simple reusable library package with no access to the blockchain database.
asch-core returns an error if the username is not set. I think that is good so 😃
Great job!
Dear @liangpeili,
this pull request makes the asch-js package compatible with the ASCH 1.4.2 release. The tests still break, but I will fix them with the next pull request.
What I've done
lib/transactions/storage.js
file and also deleted its reference in theindex.js
filelib/transactions/dapp.js
filelib/transactions/delegate.js
filelib/transactions/transaction.js
file and added theunlock
functionlib/transactions/transfer.js
filelib/transactions/uia.js
and removed the obsolete functionscreateFlags
andcreateAcl
lib/transactions/vote.js
file and added thedeleteVote
functionPackages where asch-js is used
Here I list all packages that are using asch-js today. This pull request shouldn't break them.
"asch-js": "*"
"asch-js": "https://github.com/AschPlatform/asch-js/tarball/v1.4.1",
"asch-js": "^1.3.10"
"asch-js": "^1.3.10"
asch-sandbox-dist gets the asch-js version inherited from asch-core The sandbox is using only the following two function that don't change with this pull request:
aschJS.transfer.createOutTransfer()
andAschJS.transfer.signOutTransfer
File round.js
Please review my pull request. Is something missing for you?
All the best! a1300