Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
670a292d
Commit
670a292d
authored
Sep 16, 2021
by
mdj33
Committed by
vipwzw
Sep 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ut
parent
98554f8c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
32 additions
and
33 deletions
+32
-33
docker-compose-pre.sh
build/docker-compose-pre.sh
+2
-2
chain33.para.toml
chain33.para.toml
+5
-2
chain33.toml
chain33.toml
+1
-1
testcase.sh
plugin/dapp/mix/cmd/build/testcase.sh
+0
-0
committree.go
plugin/dapp/mix/executor/committree.go
+3
-0
committree_test.go
plugin/dapp/mix/executor/committree_test.go
+4
-4
authorize_test.go
plugin/dapp/mix/types/authorize_test.go
+5
-5
deposit_test.go
plugin/dapp/mix/types/deposit_test.go
+1
-1
transferInput_test.go
plugin/dapp/mix/types/transferInput_test.go
+5
-5
transferOutput_test.go
plugin/dapp/mix/types/transferOutput_test.go
+1
-1
withdraw_test.go
plugin/dapp/mix/types/withdraw_test.go
+5
-5
ecdh_test.go
plugin/dapp/mix/wallet/ecdh_test.go
+0
-7
No files found.
build/docker-compose-pre.sh
View file @
670a292d
...
...
@@ -101,7 +101,7 @@ function main() {
echo
"============ run main end ================="
find
.
-maxdepth
1
-type
d
-name
"*-ci"
-exec
rm
-rf
{}
\;
dir
=
$(
find
.
-maxdepth
1
-type
d
!
-name
system
!
-name
.
!
-name
cross2eth
|
sed
's/^\.\///'
)
dir
=
$(
find
.
-maxdepth
1
-type
d
!
-name
system
!
-name
.
|
sed
's/^\.\///'
)
for
app
in
$dir
;
do
run_single_app
"
${
app
}
"
"
$TESTCASEFILE
"
"down"
done
...
...
@@ -112,7 +112,7 @@ function main() {
fi
elif
[
"
${
OP
}
"
==
"down"
]
;
then
if
[
"
${
DAPP
}
"
==
"all"
]
||
[
"
${
DAPP
}
"
==
"ALL"
]
;
then
dir
=
$(
find
.
-maxdepth
1
-type
d
!
-name
system
!
-name
.
!
-name
cross2eth
|
sed
's/^\.\///'
)
dir
=
$(
find
.
-maxdepth
1
-type
d
!
-name
system
!
-name
.
|
sed
's/^\.\///'
)
for
app
in
$dir
;
do
down_dapp
"
${
app
}
"
done
...
...
chain33.para.toml
View file @
670a292d
...
...
@@ -209,8 +209,8 @@ txFee=0
#私对私token转账,花费token(true)还是BTY(false),
tokenFee
=
false
#curve H point
pointHX
=
"1
019047783530092755764993423882036052945868167207386611623282189232565927950
2"
pointHY
=
"
7969140283216448215269095418467361784159407896899334866715345504515077887397
"
pointHX
=
"1
917295594134461722292316829845611055765564580964677280002116767015693329031
2"
pointHY
=
"
21116962883761739586121793871108889864627195706475546685847911817475098399811
"
#电路最大支持1024个叶子hash,10 level, 配置可以小于1024,但不能大于
maxTreeLeaves
=
1024
...
...
@@ -361,6 +361,9 @@ Enable=0
[fork.sub.multisig]
Enable
=
0
[fork.sub.mix]
Enable
=
0
[fork.sub.unfreeze]
Enable
=
0
ForkTerminatePart
=
0
...
...
chain33.toml
View file @
670a292d
...
...
@@ -299,7 +299,7 @@ pointHX="19172955941344617222923168298456110557655645809646772800021167670156933
pointHY
=
"21116962883761739586121793871108889864627195706475546685847911817475098399811"
#电路最大支持1024个叶子hash,10 level, 配置可以小于1024,但不能大于
maxTreeLeaves
=
1024
hashSeed
=
"19172955941344617222923168298456110557655645809646772800021167670156933290312"
[metrics]
#是否使能发送metrics数据的发送
...
...
plugin/dapp/mix/cmd/build/testcase.sh
View file @
670a292d
This diff is collapsed.
Click to expand it.
plugin/dapp/mix/executor/committree.go
View file @
670a292d
...
...
@@ -453,6 +453,9 @@ func CalcTreeProve(db dbm.KV, exec, symbol, rootHash, leaf string) (*mixTy.Commi
for
i
:=
status
.
ArchiveRootsSeq
;
i
>
0
;
i
--
{
roots
,
err
:=
getArchiveRoots
(
db
,
exec
,
symbol
,
i
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"getArchiveRoots,i=%d"
,
i
)
}
leaves
,
err
:=
getCommitRootLeaves
(
db
,
exec
,
symbol
,
mixTy
.
Byte2Str
(
roots
.
Roots
[
0
]))
if
err
==
nil
{
p
,
err
:=
getProveData
(
mixTy
.
Str2Byte
(
leaf
),
leaves
.
Leaves
)
...
...
plugin/dapp/mix/executor/committree_test.go
View file @
670a292d
...
...
@@ -45,9 +45,9 @@ func TestGetProveData(t *testing.T) {
proves
:=
[]
string
{
"21467822781369104390668289189963532506973289112396605437823854946060028754354"
,
"
4010939160279929375357088561050093294975728828994381439611270589357856115894
"
,
"
19203142125680456902129919467753534834062383756119332074615431762320316227830
"
,
"
5949485921924623528448830799540295699445001672535082168235329176256394356669
"
,
"
367337696696422936865919560478589243810446804477597373440139066420957868266
"
,
"
5538594811879266165080692952618163249542275094298127431082963485737222728396
"
,
"
143025316472030670451892215893941356364968202515180811944684799652132907215
"
,
}
var
leave
[][]
byte
...
...
@@ -59,7 +59,7 @@ func TestGetProveData(t *testing.T) {
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
uint32
(
5
),
ret
.
NumLeaves
)
assert
.
Equal
(
t
,
uint32
(
1
),
ret
.
ProofIndex
)
assert
.
Equal
(
t
,
"
12154966389094759868987627011400429400046999538507894392248611367616715657246
"
,
ret
.
RootHash
)
assert
.
Equal
(
t
,
"
2857051084155588640772960772751117206153267452172716633910046945631762242957
"
,
ret
.
RootHash
)
assert
.
Equal
(
t
,
len
(
proves
),
len
(
ret
.
ProofSet
))
for
i
,
k
:=
range
proves
{
assert
.
Equal
(
t
,
k
,
ret
.
ProofSet
[
i
])
...
...
plugin/dapp/mix/types/authorize_test.go
View file @
670a292d
...
...
@@ -17,18 +17,18 @@ func TestAuthorize(t *testing.T) {
r1cs
,
err
:=
frontend
.
Compile
(
ecc
.
BN254
,
backend
.
GROTH16
,
&
authCircuit
)
assert
.
NoError
(
err
)
{
authCircuit
.
TreeRootHash
.
Assign
(
"
950328190378475063285997697131233976268556642407874368795731039491163033995
"
)
authCircuit
.
AuthorizeHash
.
Assign
(
"
12118078255438699776281693699296572905522325280239057706039401491884511470990
"
)
authCircuit
.
AuthorizeSpendHash
.
Assign
(
"
21866258877426223880121052705448065394371888667902748431050285218933372701264
"
)
authCircuit
.
TreeRootHash
.
Assign
(
"
18953560960857123326054550555759265877143310030168748002053709716397549796490
"
)
authCircuit
.
AuthorizeHash
.
Assign
(
"
4895770928816523282558547614022568289586238930922185617307655942541278140196
"
)
authCircuit
.
AuthorizeSpendHash
.
Assign
(
"
17847836824302447823607018011193117302314262324241905063439417486141908449945
"
)
authCircuit
.
ReceiverPubKey
.
Assign
(
"13496572805321444273664325641440458311310163934354047265362731297880627774936"
)
authCircuit
.
ReturnPubKey
.
Assign
(
"10193030166569398670555398535278072963719579248877156082361830729347727033510"
)
authCircuit
.
AuthorizePubKey
.
Assign
(
"2
302306531516619173363925550130201424458047172090558749779153607734711372580
"
)
authCircuit
.
AuthorizePubKey
.
Assign
(
"2
1375443884718346645287794853944958188610587325651351394209548420684867245331
"
)
authCircuit
.
AuthorizePriKey
.
Assign
(
"17822967620457187568904804290291537271142779717280482398091401115827760898835"
)
authCircuit
.
NoteRandom
.
Assign
(
"2824204835"
)
authCircuit
.
Amount
.
Assign
(
"28242048"
)
authCircuit
.
SpendFlag
.
Assign
(
"1"
)
authCircuit
.
NoteHash
.
Assign
(
"
11183619348394875496624033204802036013086293645689330234403504655205992608466
"
)
authCircuit
.
NoteHash
.
Assign
(
"
4641322019922509455032097629889269851124503217947103069347447050214760728147
"
)
authCircuit
.
Path0
.
Assign
(
"19561523370160677851616596032513161448778901506614020103852017946679781620105"
)
authCircuit
.
Path1
.
Assign
(
"13898857070666440684265042188056372750257678232709763835292910585848522658637"
)
...
...
plugin/dapp/mix/types/deposit_test.go
View file @
670a292d
...
...
@@ -39,7 +39,7 @@ func TestDeposit(t *testing.T) {
{
//var witness Deposit
depositCircuit
.
NoteHash
.
Assign
(
"1
118361934839487549662403320480203601308629364568933023440350465520599260846
6"
)
depositCircuit
.
NoteHash
.
Assign
(
"1
480310916429849346668458324298543296805629717362171067907723681684558868843
6"
)
depositCircuit
.
Amount
.
Assign
(
28242048
)
depositCircuit
.
ReceiverPubKey
.
Assign
(
"13496572805321444273664325641440458311310163934354047265362731297880627774936"
)
depositCircuit
.
ReturnPubKey
.
Assign
(
"10193030166569398670555398535278072963719579248877156082361830729347727033510"
)
...
...
plugin/dapp/mix/types/transferInput_test.go
View file @
670a292d
...
...
@@ -18,15 +18,15 @@ func TestTransferInput(t *testing.T) {
assert
.
NoError
(
err
)
{
inputCircuit
.
TreeRootHash
.
Assign
(
"
950328190378475063285997697131233976268556642407874368795731039491163033995
"
)
inputCircuit
.
AuthorizeSpendHash
.
Assign
(
"
21866258877426223880121052705448065394371888667902748431050285218933372701264
"
)
inputCircuit
.
NullifierHash
.
Assign
(
"1
8261754976334473090934939020486888794395514077667802499672726421629833403191
"
)
inputCircuit
.
TreeRootHash
.
Assign
(
"
457812157273975068180144939194931372467682914013265626991402231230450012330
"
)
inputCircuit
.
AuthorizeSpendHash
.
Assign
(
"
14463129595522277797353018005538222902035087589748809554960616199173731919802
"
)
inputCircuit
.
NullifierHash
.
Assign
(
"1
2376093571606701949533526735186436482268907783512509935977783346861805262929
"
)
inputCircuit
.
ShieldAmountX
.
Assign
(
"12598656472198560295956115825363858683566688303969048230275808317634686855820"
)
inputCircuit
.
ShieldAmountY
.
Assign
(
"5287524325952639485224317845546845679649328720392059741208352845659048630229"
)
inputCircuit
.
ShieldPointHX
.
Assign
(
"19172955941344617222923168298456110557655645809646772800021167670156933290312"
)
inputCircuit
.
ShieldPointHY
.
Assign
(
"21116962883761739586121793871108889864627195706475546685847911817475098399811"
)
inputCircuit
.
ReceiverPubKey
.
Assign
(
"
13496572805321444273664325641440458311310163934354047265362731297880627774936
"
)
inputCircuit
.
ReceiverPubKey
.
Assign
(
"
20094753906906836700810108535649927887994772258248603565615394844515069419451
"
)
inputCircuit
.
ReturnPubKey
.
Assign
(
"10193030166569398670555398535278072963719579248877156082361830729347727033510"
)
inputCircuit
.
AuthorizePubKey
.
Assign
(
"2302306531516619173363925550130201424458047172090558749779153607734711372580"
)
inputCircuit
.
NoteRandom
.
Assign
(
"2824204835"
)
...
...
@@ -35,7 +35,7 @@ func TestTransferInput(t *testing.T) {
inputCircuit
.
SpendPriKey
.
Assign
(
"10190477835300927557649934238820360529458681672073866116232821892325659279502"
)
inputCircuit
.
SpendFlag
.
Assign
(
"1"
)
inputCircuit
.
AuthorizeFlag
.
Assign
(
"1"
)
inputCircuit
.
NoteHash
.
Assign
(
"1
1183619348394875496624033204802036013086293645689330234403504655205992608466
"
)
inputCircuit
.
NoteHash
.
Assign
(
"1
933334234871933218683301093524793045543211425994253628606123874146452475778
"
)
inputCircuit
.
Path0
.
Assign
(
"19561523370160677851616596032513161448778901506614020103852017946679781620105"
)
inputCircuit
.
Path1
.
Assign
(
"13898857070666440684265042188056372750257678232709763835292910585848522658637"
)
...
...
plugin/dapp/mix/types/transferOutput_test.go
View file @
670a292d
...
...
@@ -20,7 +20,7 @@ func TestTransferOutput(t *testing.T) {
{
outCircuit
.
NoteHash
.
Assign
(
"1
118361934839487549662403320480203601308629364568933023440350465520599260846
6"
)
outCircuit
.
NoteHash
.
Assign
(
"1
480310916429849346668458324298543296805629717362171067907723681684558868843
6"
)
outCircuit
.
ShieldAmountX
.
Assign
(
"12598656472198560295956115825363858683566688303969048230275808317634686855820"
)
outCircuit
.
ShieldAmountY
.
Assign
(
"5287524325952639485224317845546845679649328720392059741208352845659048630229"
)
outCircuit
.
ShieldPointHX
.
Assign
(
"19172955941344617222923168298456110557655645809646772800021167670156933290312"
)
...
...
plugin/dapp/mix/types/withdraw_test.go
View file @
670a292d
...
...
@@ -17,19 +17,19 @@ func TestWithdraw(t *testing.T) {
r1cs
,
err
:=
frontend
.
Compile
(
ecc
.
BN254
,
backend
.
GROTH16
,
&
withdrawCircuit
)
assert
.
NoError
(
err
)
{
withdrawCircuit
.
TreeRootHash
.
Assign
(
"
950328190378475063285997697131233976268556642407874368795731039491163033995
"
)
withdrawCircuit
.
AuthorizeSpendHash
.
Assign
(
"
21866258877426223880121052705448065394371888667902748431050285218933372701264
"
)
withdrawCircuit
.
NullifierHash
.
Assign
(
"1
8261754976334473090934939020486888794395514077667802499672726421629833403191
"
)
withdrawCircuit
.
TreeRootHash
.
Assign
(
"
457812157273975068180144939194931372467682914013265626991402231230450012330
"
)
withdrawCircuit
.
AuthorizeSpendHash
.
Assign
(
"
14463129595522277797353018005538222902035087589748809554960616199173731919802
"
)
withdrawCircuit
.
NullifierHash
.
Assign
(
"1
2376093571606701949533526735186436482268907783512509935977783346861805262929
"
)
withdrawCircuit
.
Amount
.
Assign
(
"28242048"
)
withdrawCircuit
.
ReceiverPubKey
.
Assign
(
"
13496572805321444273664325641440458311310163934354047265362731297880627774936
"
)
withdrawCircuit
.
ReceiverPubKey
.
Assign
(
"
20094753906906836700810108535649927887994772258248603565615394844515069419451
"
)
withdrawCircuit
.
ReturnPubKey
.
Assign
(
"10193030166569398670555398535278072963719579248877156082361830729347727033510"
)
withdrawCircuit
.
AuthorizePubKey
.
Assign
(
"2302306531516619173363925550130201424458047172090558749779153607734711372580"
)
withdrawCircuit
.
NoteRandom
.
Assign
(
"2824204835"
)
withdrawCircuit
.
SpendPriKey
.
Assign
(
"10190477835300927557649934238820360529458681672073866116232821892325659279502"
)
withdrawCircuit
.
SpendFlag
.
Assign
(
"1"
)
withdrawCircuit
.
AuthorizeFlag
.
Assign
(
"1"
)
withdrawCircuit
.
NoteHash
.
Assign
(
"1
1183619348394875496624033204802036013086293645689330234403504655205992608466
"
)
withdrawCircuit
.
NoteHash
.
Assign
(
"1
933334234871933218683301093524793045543211425994253628606123874146452475778
"
)
withdrawCircuit
.
Path0
.
Assign
(
"19561523370160677851616596032513161448778901506614020103852017946679781620105"
)
withdrawCircuit
.
Path1
.
Assign
(
"13898857070666440684265042188056372750257678232709763835292910585848522658637"
)
...
...
plugin/dapp/mix/wallet/ecdh_test.go
View file @
670a292d
...
...
@@ -42,13 +42,6 @@ func ExampleX25519() {
// Output:
}
func
ExampleX25519_Params
()
{
c25519
:=
X25519
()
p
:=
c25519
.
Params
()
fmt
.
Printf
(
"Name: %s BitSize: %d"
,
p
.
Name
,
p
.
BitSize
)
// Output: Name: Curve25519 BitSize: 255
}
func
TestX25519
(
t
*
testing
.
T
)
{
dh
:=
X25519
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment