scatterjs-plugin-eosjs can't setcode and setabi. Or is this a bug?
Closed this issue · 1 comments
leocll commented
scatterjs-plugin-eosjs
v1.5.1- Scatter Desktop v11.0.0
// 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 ["EOS8XBbHqBhqk8YmDFN9HDk61YeeWdNE7vuA2DZALukpQa8JuUmyU"], and a delay max limit of 3888000000 ms",
"file":"authorization_manager.cpp",
"line_number":524,
"method":"check_authorization"
}
]
}
}
The above error was reported using scatterjs-plugin-eosjs
. There is no error when using eosjs
. The code is as follows:
- network
const network = Network.fromJson({
blockchain:'eos',
host:'api-kylin.eoslaomao.com',
port:443,
protocol:'https',
chainId:'5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191'
});
- use
scatterjs-plugin-eosjs
const eos = this.scatter.eos(network, Eos, {expireInSeconds:60});
const options = { authorization:[`${this.account.name}@${this.account.authority}`] };
const account = this.account.name;
const completed = res => {
this.result = res;
this.sending = false;
}
const abi_ = {
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
"version": "eosio::abi/1.1",
"types": [],
"structs": [{"name": "hi","base": "","fields": [{"name": "user", "type": "name"}]}],
"actions": [{"name": "hi","type": "hi","ricardian_contract": ""}],
"tables": [],
"ricardian_clauses": [],
"variants": []
}
eos.setabi(account, abi_, options)
.then(completed).catch(completed)
- use
eosjs
const config = {
keyProvider:["5JUp2FaWbXMxShH8kXYsaiUk82jFjUtBWNDCddyPvsMAAt4NF2h"],
httpEndpoint: network.fullhost(),
chainId: network.chainId,
mockTransactions: () => null,
expireInSeconds: 60,
broadcast: true,
debug: false,
sign: true,
authorization: null
}
const eos = Eos(config);
const options = { authorization:["leoclltest14@active"] };
const account = "leoclltest14"
const completed = res => {
this.result = res;
this.sending = false;
}
const abi_ = {
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
"version": "eosio::abi/1.1",
"types": [],
"structs": [{"name": "hi","base": "","fields": [{"name": "user", "type": "name"}]}],
"actions": [{"name": "hi","type": "hi","ricardian_contract": ""}],
"tables": [],
"ricardian_clauses": [],
"variants": []
}
eos.setabi(account, abi_, options)
.then(completed).catch(completed)
Is my usage wrong, or is this a bug?
nsjames commented
Closed and fixed here: GetScatter/ScatterDesktop#396