forked from TrueCloudLab/neoneo-go
Merge pull request #3470 from nspcc-dev/contract-acc
wallet: do not store deployed contract script inside `Contract` account field
This commit is contained in:
commit
7a7a5d0322
3 changed files with 2 additions and 3 deletions
1
cli/testdata/wallet1_solo.json
vendored
1
cli/testdata/wallet1_solo.json
vendored
|
@ -65,7 +65,6 @@
|
||||||
"key": "6PYSATFztBa3CHjSR6sLAKungUEAbQUCVE16KzmaQQ38gLeYGZ9Knd5mGv",
|
"key": "6PYSATFztBa3CHjSR6sLAKungUEAbQUCVE16KzmaQQ38gLeYGZ9Knd5mGv",
|
||||||
"label": "verify",
|
"label": "verify",
|
||||||
"contract": {
|
"contract": {
|
||||||
"script": "VwEAEUBXAANA",
|
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"deployed": true
|
"deployed": true
|
||||||
},
|
},
|
||||||
|
|
|
@ -651,7 +651,8 @@ func importDeployed(ctx *cli.Context) error {
|
||||||
return cli.NewExitError("contract has no `verify` method with boolean return", 1)
|
return cli.NewExitError("contract has no `verify` method with boolean return", 1)
|
||||||
}
|
}
|
||||||
acc.Address = address.Uint160ToString(cs.Hash)
|
acc.Address = address.Uint160ToString(cs.Hash)
|
||||||
acc.Contract.Script = cs.NEF.Script
|
// Explicitly overwrite single signature script of the provided WIF since the contract is known to be deployed.
|
||||||
|
acc.Contract.Script = nil
|
||||||
acc.Contract.Parameters = acc.Contract.Parameters[:0]
|
acc.Contract.Parameters = acc.Contract.Parameters[:0]
|
||||||
for _, p := range md.Parameters {
|
for _, p := range md.Parameters {
|
||||||
acc.Contract.Parameters = append(acc.Contract.Parameters, wallet.ContractParam{
|
acc.Contract.Parameters = append(acc.Contract.Parameters, wallet.ContractParam{
|
||||||
|
|
|
@ -278,7 +278,6 @@ func TestRegenerateCLIWallet1_solo(t *testing.T) {
|
||||||
hash := state.CreateContractHash(acc3.PrivateKey().GetScriptHash(), nefFile.Checksum, m.Name)
|
hash := state.CreateContractHash(acc3.PrivateKey().GetScriptHash(), nefFile.Checksum, m.Name)
|
||||||
acc4.Address = address.Uint160ToString(hash)
|
acc4.Address = address.Uint160ToString(hash)
|
||||||
acc4.Contract = &Contract{
|
acc4.Contract = &Contract{
|
||||||
Script: nefFile.Script,
|
|
||||||
Deployed: true,
|
Deployed: true,
|
||||||
Parameters: []ContractParam{},
|
Parameters: []ContractParam{},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue