Skip to content

Commit

Permalink
wallet: do not store deployed contract script inside Contract account
Browse files Browse the repository at this point in the history
`Contract` account field should not contain deployed contract script.

Close #3348

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Jun 5, 2024
1 parent 3c471f0 commit 25d9624
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion cli/testdata/wallet1_solo.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"key": "6PYSATFztBa3CHjSR6sLAKungUEAbQUCVE16KzmaQQ38gLeYGZ9Knd5mGv",
"label": "verify",
"contract": {
"script": "VwEAEUBXAANA",
"parameters": [],
"deployed": true
},
Expand Down
2 changes: 1 addition & 1 deletion cli/wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func importDeployed(ctx *cli.Context) error {
return cli.NewExitError("contract has no `verify` method with boolean return", 1)
}
acc.Address = address.Uint160ToString(cs.Hash)
acc.Contract.Script = cs.NEF.Script
acc.Contract.Script = nil
acc.Contract.Parameters = acc.Contract.Parameters[:0]
for _, p := range md.Parameters {
acc.Contract.Parameters = append(acc.Contract.Parameters, wallet.ContractParam{
Expand Down
1 change: 0 additions & 1 deletion pkg/wallet/regenerate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ func TestRegenerateCLIWallet1_solo(t *testing.T) {
hash := state.CreateContractHash(acc3.PrivateKey().GetScriptHash(), nefFile.Checksum, m.Name)
acc4.Address = address.Uint160ToString(hash)
acc4.Contract = &Contract{
Script: nefFile.Script,
Deployed: true,
Parameters: []ContractParam{},
}
Expand Down

0 comments on commit 25d9624

Please sign in to comment.