Commit graph

75 commits

Author SHA1 Message Date
Evgenii Stratonikov
2cb10edfd2 [#142] container: do not fail when deleting missing container
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-25 18:10:47 +03:00
Evgenii Stratonikov
6bd088aa9f [#142] container: panic on missing container
Return more descriptive error message for a user.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-25 18:10:47 +03:00
Evgenii Stratonikov
8c8e4a6d85 [#156] container: fix domain owner check
Container contract owns all registered domains.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-22 09:08:13 +03:00
Evgenii Stratonikov
c957b9ca69 [#151] container: require additional fee for nice-name
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 13:11:53 +03:00
Evgenii Stratonikov
7fe7188e7d [#150] container: allow only alphabet calls in SetEACL
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 11:51:16 +03:00
Evgenii Stratonikov
0ef906fb03 [#150] container: allow only alphabet calls in Delete
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 11:51:16 +03:00
Evgenii Stratonikov
e5c5cc30c0 [#150] container: make config key public
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 11:51:16 +03:00
Evgenii Stratonikov
fef6a6cb36 [#150] container: check domain owner in Put
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 11:51:16 +03:00
Evgenii Stratonikov
a7601334f7 [#150] container: allow only alphabet calls in Put
For notary-enabled environment we expect `put` to be signed by alphabet.
Also group notary-disabled logic inside a single if and
add tests for balance checks.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 11:51:16 +03:00
Evgenii Stratonikov
18ff4ea116 container: register NNS root on update
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-08 14:27:22 +03:00
Evgenii Stratonikov
79ca1a4451 [#135] container: remove nice names on deletion
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-07 12:25:19 +03:00
Evgenii Stratonikov
e4e306c63b [#135] container: allow to register nice names in NNS
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-07 12:25:19 +03:00
Alex Vanin
6d0c5d110c [#107] Remove contract owner argument at contract deploy
Contract owner entity does exist anymore. Contract migration
now managed by side chain committee which are Alphabet nodes of
the Inner Ring.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 11:06:48 +03:00
Alex Vanin
edd4864e39 [#130] Panic at contract update failures
There is no practical cases not to panic at contract
update routine.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 09:54:52 +03:00
Alex Vanin
b555e200f4 [#128] Rename migrate methods to update
Neo Legacy used migration mechanism to update contracts.
N3 provides update method in native management contract.
Therefore, it makes sense to rename `Migrate` to `Update`.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-21 12:28:35 +03:00
Alex Vanin
b45a4162b4 [#121] container: Reword panic messages for better error wrapping
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-21 09:57:47 +03:00
Alex Vanin
ea89844033 [#121] container: Catch non-existent container owner case
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-21 09:57:47 +03:00
Alex Vanin
cb385c920f [#121] container: Do not fail on deleting non-existent container
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-21 09:57:47 +03:00
Alex Vanin
8bd25230fa [#118] *: Encode semver in version number
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-29 15:01:50 +03:00
Alex Vanin
c7ed05cc2e [#112] Remove to v0.9.2 migration code
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 15:03:40 +03:00
Alex Vanin
726e7995fc [#105] container: Add docs
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
b6b3f17cd1 [#105] *: Add doc.go files for each contract
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
8b7d08cb08 [#105] *: Remove contract from package names
`contract` postfix is redundant and makes autogenerated
docs looks ugly.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
12889ac87e [#102] container: Migrate container estimation storage
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 17:58:55 +03:00
Alex Vanin
711962924f [#102] container: Make PutContainerSize stable for simultaneous invocations in one block
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 17:58:55 +03:00
Alex Vanin
2402768eae [#102] container: Migrate container listing storage
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 17:58:55 +03:00
Alex Vanin
98c5fd25c3 [#102] container: Make Put and Delete stable for simultaneous invocations in one block
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 17:58:55 +03:00
Alex Vanin
01b12bcd56 [#96] *: Specify permissions in contract manifests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-24 16:16:02 +03:00
Alex Vanin
14382d701c [#94] *: Fix parameter types in notification manifest
neo-go v0.95.2+ has strict notification type checker
enabled by default.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-17 16:44:00 +03:00
Alex Vanin
a2c985ae4b [#92] container: Add balance check before new container notification
Balance check at container.Put command will drop some invalid
transactions from the side chain network before inner ring
approval.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-15 17:01:42 +03:00
Alex Vanin
cb2559f590 [#92] container: Remove migration code
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-15 17:01:42 +03:00
Alex Vanin
79b4f2cc64 [#88] container: Migrate container and eACL structures
In v0.8.0:
  - containers were stored as stable marshaled binary,

In v0.9.0:
  - containers are stored the same way as eACL,
  - eACL structure has new `token []byte field`.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-03 14:09:40 +03:00
Alex Vanin
6daaa0c6d2 [#88] container: Use large scope for container contract migration
With contract migration from v0.8.0 to v0.9.0 we need to replace
structures in contract memory. This produces native contract calls
that are not available in scope of `management.Update`. Therefore
we need to apply new scope first.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-03 14:09:40 +03:00
Alex Vanin
2e2eb15729 [#88] *: Provide data in migrate method of the contracts
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-03 14:09:40 +03:00
Evgenii Stratonikov
db2b1be746 [#79] Panic instead of returning bool value
There is a number of contracts which return only `true` value.
Also handling `FAULT` on the client is easier then also checking return
value.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-01 12:10:28 +03:00
Alex Vanin
de255b0a43 [#78] container: Support session token
Container now stored the same way as ExtendedACL: with
signature and session token. This is required for signature
checks when session token presented.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-27 10:05:50 +03:00
Alex Vanin
ccafbcbdcd [#78] container: Do not check signature in contract
Signature check may fail if container has NFT attributes.
So these checks should be done in alphabet nodes and not
inside the contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-27 10:05:50 +03:00
Alex Vanin
3e70c37c22 [#78] container: Use alphabet approve in SetEACL method
Store public key of eACL signature because it might
be set up by NFT owner.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-27 10:05:50 +03:00
Alex Vanin
4585f96acf [#75] Fix typos
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-19 11:54:17 +03:00
Evgenii Stratonikov
dd98bee590 [#72] Replace Init() methods with _deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-12 16:56:52 +03:00
Alex Vanin
e4ba936f50 [#74] Log notary disabled flag at init
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
400b9bebb4 [#74] container: Support notary disabled work flow
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
622a83e014 [#74] Add notary disabled option to contracts
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
f884e3d665 [#68] Use unified format for transferX details
Unified format uses transfer type as the first byte
and extra details next. List of transfer types used in
contracts defined in `transfer.go`. It includes:
- mint,
- burn,
- lock,
- unlock,
- container fee.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-04-08 17:04:31 +03:00
Alex Vanin
79cff420b4 [#58] container: Use alphabet list from chain
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-25 18:19:47 +03:00
Alex Vanin
5e28938286 [#62] Remove methods with notifications from safe list
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-22 18:10:42 +03:00
Alex Vanin
a1f0919f98 [#61] container: Unify naming for new epoch processing functions
The same name is in network map and balance contracts.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-19 15:04:47 +03:00
Alex Vanin
44cb7ccfd8 [#25] container: Use interop.Hash160 for contract addresses
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-19 15:04:47 +03:00
Alex Vanin
97a5e27403 [#59] Update to pre-released version of neo-go v0.94.0
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Pavel Karpy
8af80e67aa [#37] Use readonly context
Delete initializing of R/W context in `init()`
and start using readonly storage context in
methods where it is possible.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-03-12 10:36:15 +03:00