Merge pull request #2380 from nspcc-dev/notary-tunes

*: several Notary subsystem adjustments, part 2
This commit is contained in:
Roman Khimov 2022-06-01 15:34:07 +03:00 committed by GitHub
commit 80823c58d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 89 additions and 133 deletions

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/engine
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/events
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/iterator
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/nft
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -3,7 +3,7 @@ module github.com/nspcc-dev/neo-go/examples/nft-nd-nns
go 1.16
require (
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220523110500-1cc107d4610e
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220601121043-3c2fc165b609
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5
github.com/stretchr/testify v1.7.0
)

View file

@ -171,7 +171,7 @@ github.com/nspcc-dev/dbft v0.0.0-20191209120240-0d6b7568d9ae/go.mod h1:3FjXOoHmA
github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a/go.mod h1:/YFK+XOxxg0Bfm6P92lY5eDSLYfp06XOdL8KAVgXjVk=
github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62prQSqizzoagHmuuKoz8QMkU3SzBoKdEvm3aQ=
github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
github.com/nspcc-dev/dbft v0.0.0-20220414131237-e497bbf7868e/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
github.com/nspcc-dev/dbft v0.0.0-20220523093034-c35adf004e6f/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U=
github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 h1:n4ZaFCKt1pQJd7PXoMJabZWK9ejjbLOVrkl/lOUmshg=
github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U=
@ -179,10 +179,10 @@ github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y=
github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU=
github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg=
github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM=
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220523110500-1cc107d4610e h1:KlCtKZvCzPysT1pnK4e2TSyXF/CFsfTA7AU8P9jbeLU=
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220523110500-1cc107d4610e/go.mod h1:IYV+4Zl0zKAcH7BP09lx3Q9UYFzk47WH2vTslZN3CRA=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220601121043-3c2fc165b609 h1:g6M49nGOWscRDjdOhc66pYK90gQZMiVQpiejF0fhOAg=
github.com/nspcc-dev/neo-go v0.98.6-pre.0.20220601121043-3c2fc165b609/go.mod h1:Bb71wjxD9RMSXFhX3OCWlBm1eu/ma9YKm8Ytl5TXEl4=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1 h1:SVqc523pZsSaS9vnPS1mm3VV6b6xY0gvdA0uYJ/GWZQ=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
@ -444,7 +444,8 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/nft-nd
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/oracle
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/runtime
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/storage
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/timer
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

View file

@ -2,4 +2,4 @@ module github.com/nspcc-dev/neo-go/examples/token
go 1.16
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5

View file

@ -1,2 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=

2
go.mod
View file

@ -12,7 +12,7 @@ require (
github.com/mr-tron/base58 v1.2.0
github.com/nspcc-dev/dbft v0.0.0-20220523093034-c35adf004e6f
github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659
github.com/nspcc-dev/rfc6979 v0.2.0
github.com/pierrec/lz4 v2.6.1+incompatible

4
go.sum
View file

@ -185,8 +185,8 @@ github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y=
github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU=
github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg=
github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c h1:3e7iTZ2/wssMdIkpGb6KMhLJiBiQVxEQDKM+6K1VCLM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220523110142-d8f7d5d5b67c/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5 h1:bWau94hHSkztNF7EDTkvQAc8xjsxGMnaFf1DrXguvX8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220601120906-3bec6657f5c5/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1 h1:SVqc523pZsSaS9vnPS1mm3VV6b6xY0gvdA0uYJ/GWZQ=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=

View file

@ -14,8 +14,8 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/chaindump"
"github.com/nspcc-dev/neo-go/pkg/core/native"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/interop/native/roles"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
@ -186,7 +186,7 @@ func initBasicChain(t *testing.T, e *neotest.Executor) {
require.NoError(t, err)
require.NoError(t, ntr.Accounts[0].Decrypt("one", ntr.Scrypt))
designateSuperInvoker.Invoke(t, stackitem.Null{}, "designateAsRole",
int64(roles.P2PNotary), []interface{}{ntr.Accounts[0].PrivateKey().PublicKey().Bytes()})
int64(noderoles.P2PNotary), []interface{}{ntr.Accounts[0].PrivateKey().PublicKey().Bytes()})
t.Logf("Designated Notary node: %s", hex.EncodeToString(ntr.Accounts[0].PrivateKey().PublicKey().Bytes()))
// Block #10: push verification contract with arguments into the chain.
@ -270,6 +270,10 @@ func initBasicChain(t *testing.T, e *neotest.Executor) {
bw.Reset()
txSendRaw.EncodeBinary(bw.BinWriter)
t.Logf("sendrawtransaction: \n\tbase64: %s\n\tHash LE: %s", base64.StdEncoding.EncodeToString(bw.Bytes()), txSendRaw.Hash().StringLE())
sr20, err := e.Chain.GetStateModule().GetStateRoot(20)
require.NoError(t, err)
t.Logf("Block #20 stateroot LE: %s", sr20.Root.StringLE())
}
func newDeployTx(t *testing.T, e *neotest.Executor, sender neotest.Signer, sourcePath, configPath string, deploy bool) (util.Uint256, util.Uint160) {

View file

@ -25,13 +25,13 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/native"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativeprices"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/storage"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neo-go/pkg/interop/native/roles"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
@ -1454,7 +1454,7 @@ func TestBlockchain_VerifyTx(t *testing.T) {
keys = append(keys, p.Bytes())
}
designateSuperInvoker.Invoke(t, stackitem.Null{}, "designateAsRole",
int64(roles.Oracle), keys)
int64(noderoles.Oracle), keys)
t.Run("Valid", func(t *testing.T) {
tx := getOracleTx(t)
@ -1671,7 +1671,7 @@ func TestBlockchain_VerifyTx(t *testing.T) {
notary, err := wallet.NewAccount()
require.NoError(t, err)
designateSuperInvoker.Invoke(t, stackitem.Null{}, "designateAsRole",
int64(roles.P2PNotary), []interface{}{notary.PrivateKey().PublicKey().Bytes()})
int64(noderoles.P2PNotary), []interface{}{notary.PrivateKey().PublicKey().Bytes()})
txSetNotary := transaction.New([]byte{byte(opcode.RET)}, 0)
txSetNotary.Signers = []transaction.Signer{
{

View file

@ -11,9 +11,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm/emit"
)
// reservedContractID represents the upper bound of the reserved IDs for native contracts.
const reservedContractID = -100
// Contracts is a set of registered native contracts.
type Contracts struct {
Management *Management

View file

@ -6,9 +6,9 @@ import (
"github.com/nspcc-dev/neo-go/pkg/config"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/interop/native/roles"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
"github.com/nspcc-dev/neo-go/pkg/util"
@ -85,7 +85,7 @@ func TestGAS_RewardWithP2PSigExtensionsEnabled(t *testing.T) {
require.NoError(t, err)
notaryNodesPublicKeys[i] = notaryNodes[i].PublicKey().Bytes()
}
e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation)).Invoke(t, stackitem.Null{}, "designateAsRole", int(roles.P2PNotary), notaryNodesPublicKeys)
e.CommitteeInvoker(e.NativeHash(t, nativenames.Designation)).Invoke(t, stackitem.Null{}, "designateAsRole", int(noderoles.P2PNotary), notaryNodesPublicKeys)
for _, notaryNode := range notaryNodes {
e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(0))
}

View file

@ -7,9 +7,9 @@ import (
"github.com/nspcc-dev/neo-go/pkg/config"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/interop/native/roles"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
"github.com/nspcc-dev/neo-go/pkg/util"
@ -191,7 +191,7 @@ func TestNotary_NotaryNodesReward(t *testing.T) {
notaryNodesPublicKeys[i] = notaryNodes[i].PublicKey().Bytes()
}
designationCommitteeInvoker.Invoke(t, stackitem.Null{}, "designateAsRole", int(roles.P2PNotary), notaryNodesPublicKeys)
designationCommitteeInvoker.Invoke(t, stackitem.Null{}, "designateAsRole", int(noderoles.P2PNotary), notaryNodesPublicKeys)
for _, notaryNode := range notaryNodes {
e.CheckGASBalance(t, notaryNode.GetScriptHash(), big.NewInt(0))
}

View file

@ -8,5 +8,5 @@ const (
StateValidator Role = 4
Oracle Role = 8
NeoFSAlphabet Role = 16
P2PNotary Role = 128
P2PNotary Role = 32
)

View file

@ -39,12 +39,13 @@ type NotaryCache struct {
}
const (
notaryContractID = reservedContractID - 1
notaryContractID = -10
// prefixDeposit is a prefix for storing Notary deposits.
prefixDeposit = 1
defaultDepositDeltaTill = 5760
defaultMaxNotValidBeforeDelta = 140 // 20 rounds for 7 validators, a little more than half an hour
defaultNotaryServiceFeePerKey = 1000_0000 // 0.1 GAS
defaultMaxNotValidBeforeDelta = 140 // 20 rounds for 7 validators, a little more than half an hour
defaultNotaryServiceFeePerKey = 1000_0000 // 0.1 GAS
maxNotaryServiceFeePerKey = 1_0000_0000 // 1 GAS
)
var (
@ -442,8 +443,8 @@ func (n *Notary) GetNotaryServiceFeePerKey(dao *dao.Simple) int64 {
// setNotaryServiceFeePerKey is a Notary contract method and sets a reward per notary request key for notary nodes.
func (n *Notary) setNotaryServiceFeePerKey(ic *interop.Context, args []stackitem.Item) stackitem.Item {
value := toInt64(args[0])
if value < 0 {
panic("NotaryServiceFeePerKey can't be negative")
if value < 0 || value > maxNotaryServiceFeePerKey {
panic("NotaryServiceFeePerKey value is out of range")
}
if !n.NEO.checkCommittee(ic) {
panic("invalid committee signature")

View file

@ -17,10 +17,10 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/core/mempool"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/interop/native/roles"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/neotest/chain"
@ -158,7 +158,7 @@ func TestNotary(t *testing.T) {
notaryNodes := []interface{}{acc1.PrivateKey().PublicKey().Bytes(), acc2.PrivateKey().PublicKey().Bytes()}
designationSuperInvoker.Invoke(t, stackitem.Null{}, "designateAsRole",
int64(roles.P2PNotary), notaryNodes)
int64(noderoles.P2PNotary), notaryNodes)
type requester struct {
accounts []*wallet.Account

View file

@ -52,14 +52,9 @@ func TestAttribute_EncodeBinary(t *testing.T) {
}
testserdes.EncodeDecodeBinary(t, attr, new(Attribute))
})
t.Run("bad format: too long", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes([]byte{1, 2, 3, 4, 5})
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(NotValidBefore)))
})
t.Run("bad format: too short", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes([]byte{1, 2, 3})
bw.WriteBytes([]byte{1, 2, 3})
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(NotValidBefore)))
})
})
@ -96,14 +91,9 @@ func TestAttribute_EncodeBinary(t *testing.T) {
}
testserdes.EncodeDecodeBinary(t, attr, new(Attribute))
})
t.Run("negative: too long", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes(make([]byte, util.Uint256Size+1))
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(Conflicts)))
})
t.Run("negative: bad uint256", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes(make([]byte, util.Uint256Size-1))
bw.WriteBytes(make([]byte, util.Uint256Size-1))
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(Conflicts)))
})
})
@ -117,14 +107,9 @@ func TestAttribute_EncodeBinary(t *testing.T) {
}
testserdes.EncodeDecodeBinary(t, attr, new(Attribute))
})
t.Run("bad format: too long", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes(make([]byte, 2))
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(NotaryAssisted)))
})
t.Run("bad format: too short", func(t *testing.T) {
bw := io.NewBufBinWriter()
bw.WriteVarBytes([]byte{})
bw.WriteBytes([]byte{})
require.Error(t, testserdes.DecodeBinary(bw.Bytes(), new(NotaryAssisted)))
})
})

View file

@ -15,10 +15,10 @@ const (
// List of valid attribute types.
const (
HighPriority AttrType = 1
OracleResponseT AttrType = 0x11 // OracleResponse
NotValidBeforeT AttrType = ReservedLowerBound // NotValidBefore
ConflictsT AttrType = ReservedLowerBound + 1 // Conflicts
NotaryAssistedT AttrType = ReservedLowerBound + 2 // NotaryAssisted
OracleResponseT AttrType = 0x11 // OracleResponse
NotValidBeforeT AttrType = 0x20 // NotValidBefore
ConflictsT AttrType = 0x21 // Conflicts
NotaryAssistedT AttrType = 0x22 // NotaryAssisted
)
func (a AttrType) allowMultiple() bool {

View file

@ -10,9 +10,9 @@ func _() {
var x [1]struct{}
_ = x[HighPriority-1]
_ = x[OracleResponseT-17]
_ = x[NotValidBeforeT-224]
_ = x[ConflictsT-225]
_ = x[NotaryAssistedT-226]
_ = x[NotValidBeforeT-32]
_ = x[ConflictsT-33]
_ = x[NotaryAssistedT-34]
}
const (
@ -31,8 +31,8 @@ func (i AttrType) String() string {
return _AttrType_name_0
case i == 17:
return _AttrType_name_1
case 224 <= i && i <= 226:
i -= 224
case 32 <= i && i <= 34:
i -= 32
return _AttrType_name_2[_AttrType_index_2[i]:_AttrType_index_2[i+1]]
default:
return "AttrType(" + strconv.FormatInt(int64(i), 10) + ")"

View file

@ -12,21 +12,12 @@ type Conflicts struct {
// DecodeBinary implements the io.Serializable interface.
func (c *Conflicts) DecodeBinary(br *io.BinReader) {
bytes := br.ReadVarBytes(util.Uint256Size)
if br.Err != nil {
return
}
hash, err := util.Uint256DecodeBytesBE(bytes)
if err != nil {
br.Err = err
return
}
c.Hash = hash
c.Hash.DecodeBinary(br)
}
// EncodeBinary implements the io.Serializable interface.
func (c *Conflicts) EncodeBinary(w *io.BinWriter) {
w.WriteVarBytes(c.Hash.BytesBE())
c.Hash.EncodeBinary(w)
}
func (c *Conflicts) toJSONMap(m map[string]interface{}) {

View file

@ -1,9 +1,6 @@
package transaction
import (
"encoding/binary"
"fmt"
"github.com/nspcc-dev/neo-go/pkg/io"
)
@ -14,22 +11,12 @@ type NotValidBefore struct {
// DecodeBinary implements the io.Serializable interface.
func (n *NotValidBefore) DecodeBinary(br *io.BinReader) {
bytes := br.ReadVarBytes(4)
if br.Err != nil {
return
}
if len(bytes) != 4 {
br.Err = fmt.Errorf("expected 4 bytes, got %d", len(bytes))
return
}
n.Height = binary.LittleEndian.Uint32(bytes)
n.Height = br.ReadU32LE()
}
// EncodeBinary implements the io.Serializable interface.
func (n *NotValidBefore) EncodeBinary(w *io.BinWriter) {
bytes := make([]byte, 4)
binary.LittleEndian.PutUint32(bytes, n.Height)
w.WriteVarBytes(bytes)
w.WriteU32LE(n.Height)
}
func (n *NotValidBefore) toJSONMap(m map[string]interface{}) {

View file

@ -1,8 +1,6 @@
package transaction
import (
"fmt"
"github.com/nspcc-dev/neo-go/pkg/io"
)
@ -13,20 +11,12 @@ type NotaryAssisted struct {
// DecodeBinary implements the io.Serializable interface.
func (n *NotaryAssisted) DecodeBinary(br *io.BinReader) {
bytes := br.ReadVarBytes(1)
if br.Err != nil {
return
}
if len(bytes) != 1 {
br.Err = fmt.Errorf("expected 1 byte, got %d", len(bytes))
return
}
n.NKeys = bytes[0]
n.NKeys = br.ReadB()
}
// EncodeBinary implements the io.Serializable interface.
func (n *NotaryAssisted) EncodeBinary(w *io.BinWriter) {
w.WriteVarBytes([]byte{n.NKeys})
w.WriteB(n.NKeys)
}
func (n *NotaryAssisted) toJSONMap(m map[string]interface{}) {

View file

@ -23,7 +23,7 @@ const (
Oracle Role = 8
NeoFSAlphabet Role = 16
// P2PNotary is an extension of Neo protocol available on specifically configured NeoGo networks.
P2PNotary Role = 128
P2PNotary Role = 32
)
// GetDesignatedByRole represents `getDesignatedByRole` method of RoleManagement native contract.

View file

@ -72,10 +72,10 @@ const (
verifyWithArgsContractHash = "0dce75f52adb1a4c5c6eaa6a34eb26db2e5b3781"
nnsContractHash = "ee92563903e4efd53565784080b2dbdc5c37e21f"
nnsToken1ID = "6e656f2e636f6d"
nfsoContractHash = "5f9ebd6b001b54c7bc70f96e0412fcf415dfe09f"
nfsoContractHash = "c7ec8e0fb4d669913e4ffdd4ba4fa3502e5d2d10"
nfsoToken1ID = "7e244ffd6aa85fb1579d2ed22e9b761ab62e3486"
invokescriptContractAVM = "VwIADBQBDAMOBQYMDQIODw0DDgcJAAAAAErZMCQE2zBwaEH4J+yMqiYEEUAMFA0PAwIJAAIBAwcDBAUCAQAOBgwJStkwJATbMHFpQfgn7IyqJgQSQBNA"
block20StateRootLE = "cda0adf452c190700f792bcac29973b85532b7c27192e96172cfa0c8acaa4f9e"
block20StateRootLE = "93ebfc8b030de02c5548ae08ac4a0ea39c12c82e62609ae07bdf3d803bcf9ffd"
)
var (
@ -917,7 +917,7 @@ var rpcTestCases = map[string][]rpcTestCase{
chg := []storage.Operation{{
State: "Changed",
Key: []byte{0xfa, 0xff, 0xff, 0xff, 0xb},
Value: []byte{0x1e, 0xb, 0xca, 0xeb, 0x53, 0x79, 0x12},
Value: []byte{0x58, 0xe0, 0x6f, 0xeb, 0x53, 0x79, 0x12},
}, {
State: "Added",
Key: []byte{0xfb, 0xff, 0xff, 0xff, 0x14, 0xd6, 0x24, 0x87, 0x12, 0xff, 0x97, 0x22, 0x80, 0xa0, 0xae, 0xf5, 0x24, 0x1c, 0x96, 0x4d, 0x63, 0x78, 0x29, 0xcd, 0xb},
@ -929,7 +929,7 @@ var rpcTestCases = map[string][]rpcTestCase{
}, {
State: "Changed",
Key: []byte{0xfa, 0xff, 0xff, 0xff, 0x14, 0xee, 0x9e, 0xa2, 0x2c, 0x27, 0xe3, 0x4b, 0xd0, 0x14, 0x8f, 0xc4, 0x10, 0x8e, 0x8, 0xf7, 0x4e, 0x8f, 0x50, 0x48, 0xb2},
Value: []byte{0x41, 0x01, 0x21, 0x05, 0xf6, 0x99, 0x28, 0x2d, 0xb},
Value: []byte{0x41, 0x01, 0x21, 0x05, 0x50, 0x28, 0x27, 0x2d, 0x0b},
}}
// Can be returned in any order.
assert.ElementsMatch(t, chg, res.Diagnostics.Changes)
@ -2465,7 +2465,7 @@ func checkNep17Balances(t *testing.T, e *executor, acc interface{}) {
},
{
Asset: e.chain.UtilityTokenHash(),
Amount: "47102293830",
Amount: "47102199200",
LastUpdated: 19,
}},
Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(),

Binary file not shown.

View file

@ -106,7 +106,7 @@ type (
}
)
// isMainCompleted denotes whether all signatures for the main transaction was collected.
// isMainCompleted denotes whether all signatures for the main transaction were collected.
func (r request) isMainCompleted() bool {
if r.witnessInfo == nil {
return false