GetScatter / ScatterDesktop

Connect to applications on EOS, Ethereum, and Tron. Exchange tokens with ease. Manage your assets safely. All in a simple to use interface.
https://get-scatter.com/
GNU General Public License v3.0
501 stars 197 forks source link

EOS setcode and setabi error #396

Open leocll opened 5 years ago

leocll commented 5 years ago

Successful with ScatterWebExtension, error with ScatterDesktop. This mistake has been bothering me all day. I saw other issues about it, but none of them solved the problem. Help me, I will be grateful.

leocll commented 5 years ago

The transfer can be successful, but setcode and setabi will report the error.

// transfer, successful
eos.contract('eosio.token').then(contract => {
        contract.transfer(this.account.name, "leoclltest12", '1.0000 EOS', "ceshi", options)
            .then(completed).catch(completed)
    })
// setabi, error
eos.setabi(this.account.name, abi_, options)
        .then(completed).catch(completed)
// setabi, error
eos.contract('eosio').then(contract => {
        contract.setabi(this.account.name, "0e656f73696f3a3a6162692f312e31000102686900010475736572046e616d6501000000000000806b02686900000000", options)
            .then(completed).catch(completed)
    })
nsjames commented 5 years ago

5ed993662e78638d92aa5698386e616a155a4598 fixed here, staged for next patch (11.0.1)

leocll commented 5 years ago

I used ScatterDesktop for 11.0.1 and this problem still exists.T_T

nsjames commented 5 years ago

Don't use the release version. Build from master, as the fix only exists there. The prerelease does not have it.

leocll commented 5 years ago

I have built from master, but there is a new error "No Identity". I am still waiting for you to release a new version.

leocll commented 5 years ago

You only fixed setabi, forgot the setcode. @nsjames

leocll commented 5 years ago

I hope you can fix it as soon as possible. This is very important to my project. I will be very grateful. @nsjames

leocll commented 5 years ago

There is still a problem with setcode

scatter.eos code

// error
eos = this.scatter.eos(network, Eos, {chainId: network.chainId, expireInSeconds: 60});
eos.setcode(this.account.name, 0, 0, this.hexCharCodeToStr(code), options)
.then(completed).catch(completed)

error

"{"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"Provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{\"actor\":\"leoclltest14\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys [\"EOS5JaQ2qpWnsL5W6KoUooTaEU73SWY49gw5pA6jNLVzFuAJp4EsN\"], and a delay max limit of 3888000000 ms","file":"authorization_manager.cpp","line_number":524,"method":"check_authorization"}]}}"

eos code

// success
eos = Eos(config);
eos.setcode(this.account.name, 0, 0, this.hexCharCodeToStr(code), options)
.then(completed).catch(completed)

Complete Code @nsjames

nsjames commented 5 years ago

Hmm. Wonder why it didn't work for both. Scatter's core code (including all eosjs parsing internally) is undergoing a huge extrapolation right now and it's likely these issues won't exist after it's done.

This will have to wait for next release though which has to go through a testing phase.

You can track the progress on these: https://github.com/GetScatter/ScatterCore https://github.com/GetScatter/ScatterDesktop/tree/core-extrapolation