Commit c0547090 authored by madengji's avatar madengji Committed by vipwzw

support token asset to mix

parent ffc16dbd
...@@ -203,6 +203,17 @@ useBalance=false ...@@ -203,6 +203,17 @@ useBalance=false
ethMapFromExecutor="paracross" ethMapFromExecutor="paracross"
ethMapFromSymbol="coins.bty" ethMapFromSymbol="coins.bty"
[exec.sub.mix]
#私对私的交易费,交易比较大,需要多的手续费
txFee=0
#私对私token转账,花费token(true)还是BTY(false),
tokenFee=false
#curve H point
pointHX="10190477835300927557649934238820360529458681672073866116232821892325659279502"
pointHY="7969140283216448215269095418467361784159407896899334866715345504515077887397"
#电路最大支持1024个叶子hash,10 level, 配置可以小于1024,但不能大于
maxTreeLeaves=1024
#系统中所有的fork,默认用chain33的测试网络的 #系统中所有的fork,默认用chain33的测试网络的
#但是我们可以替换 #但是我们可以替换
[fork.system] [fork.system]
......
...@@ -289,6 +289,17 @@ evmGasLimit=2000000 ...@@ -289,6 +289,17 @@ evmGasLimit=2000000
#evm内部调试输出,指令级的,默认关闭,0:关闭;1:打开 #evm内部调试输出,指令级的,默认关闭,0:关闭;1:打开
evmDebugEnable=0 evmDebugEnable=0
[exec.sub.mix]
#私对私的交易费,交易比较大,需要多的手续费
txFee=100000000
#私对私token转账,花费token(true)还是BTY(false),
tokenFee=false
#curve H point
pointHX="10190477835300927557649934238820360529458681672073866116232821892325659279502"
pointHY="7969140283216448215269095418467361784159407896899334866715345504515077887397"
#电路最大支持1024个叶子hash,10 level, 配置可以小于1024,但不能大于
maxTreeLeaves=1024
[metrics] [metrics]
#是否使能发送metrics数据的发送 #是否使能发送metrics数据的发送
enableMetrics=false enableMetrics=false
......
...@@ -75,6 +75,8 @@ function mix_enable_privacy() { ...@@ -75,6 +75,8 @@ function mix_enable_privacy() {
function mix_transfer() { function mix_transfer() {
echo "=========== # mix chain transfer =============" echo "=========== # mix chain transfer ============="
${CLI} send coins send_exec -a 10 -e mix -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01
##config mix key ##config mix key
${CLI} send coins transfer -a 10 -n transfer -t 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01 ${CLI} send coins transfer -a 10 -n transfer -t 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01
#authorize #authorize
...@@ -95,7 +97,7 @@ function mix_transfer() { ...@@ -95,7 +97,7 @@ function mix_transfer() {
#1nl #1nl
${CLI} send mix config register -r 1499328046806813717988379826525346013601394010052157072491414645500411978017 -e 0abaa15456580365b90f84f22186f99250f4198f8df7319bcced1606085a1e01 -a 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115 ${CLI} send mix config register -r 1499328046806813717988379826525346013601394010052157072491414645500411978017 -e 0abaa15456580365b90f84f22186f99250f4198f8df7319bcced1606085a1e01 -a 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115
${CLI} send coins send_exec -a 10 -e mix -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01 ${CLI} send mix config register -r 7166643181671374870524536201432214798965258692016821447324045928745450625215 -e a97592e700eb0f87c5738b35c8d460ce33a4a59bde6128081ddd042c3c262f76 -a 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs -k 0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71
##config deposit circuit vk ##config deposit circuit vk
${CLI} send mix config vk -c 0 -z 1f8b08000000000000ff6c51795053eb15ff4e7281e0f086f5098ff7221114509692581441b4611111c160559055960b449280240842adb22b8bb2094a0551912aa853d08a452bd2a9a0b6022e55c74e519246a86804b57a04f47612c4ce74fad76fbeb3fc96efb0f509db97c96303186da533c449bbc5b2e4207a3730f90428007f600a09b00204c0946b910f4c2501235166bc449c10284bcf54c881a923842c640ad8006c9a2f98dd0096af1b30c50458be7c2d12e2c814b10158f4725d990d2c1f3760f61360f9f0bfa2408b84f09812dda060b60c2ca11b30a5045842be1609b1640e008081bf8496d23285aea70f1c4268a68c0de025576464262878b9bc8038a9342e844ee6c5cb04eecb5d0304c2a424b18cf6e2f9d112c5ff69f0f6cca604cedc2630070970e6c6b52f421631156c00cedc926e840510ae730bdb66330898436c00ee372b41bcc8e8af62fcff8a5512008020606a0921364c0d0bc0e47fe7b44d60aab5ba553add6ff5ea39ddd2595dedd7cc670eb3003891d17245865896acbd0d1811f285b261f2b55a141e0cb7b2cb5650edb824f244cad4c47a677cb79d9f3af5278f179fceaa06a59e13a140a1e16052f395a5279fe3dd5daf4b7c827f27c3965a8db9c42a568956cd1569b6966b34444bd656dd347cc6e1d5396c7655c9f5e679b762a85bf4d63b6dc6e3683e154f697e9d900d14662bd4cea71f769860daaf9e29ad7e5f4630708c2ffca3dbeb22341067b4bee93adfaa63fbebd588fb6b3f0812b1d1f042e1b5d6e66348d78f979ab3252a5cb8e831a97d193108149aced4bdfbe866f102b3cb9c573f3cd583b8c0a37d6fe391ad13e8c0bd292de84bc9224417f556fb83f4bb9ad17eec513f393a62b7f11e5e0d77e106e7d4cbd1f17ec1314596e21250382a6ee82e81db3cac1cbc6c5a6716f21794e839af0f2e6fb1409e1337356a91c24ce76e68ec3d377d7fad06472a2e5dfce870d1057d068523aedce275e812c95bb7e2674da78142faec8cc3631bcb30dc6cd9dd417ff75a0f9b2637ab0d0a6346d15594f45e31fac3351d5b8da5bd5cffb6d20377da08e61936c4b6a1cf1249596e8c4883662182ebde669272a030e7173762854fcda3d1652235ae6fbbe9306a869e4e9e3c7a60086d565c7137aec997135d58a030f183e9b0d71beb1cecf922d967b7ab780d3a58efda1059ff3210ad8397b9de342fb5060a6704ab948eaa497d0c88c813559e18106268cdcec20df6515de894f1a863ba6b8385cedf49ae6f9b5e627704ae2e6f5c5d3becf80a237f7c78e08972b0131dbb970ac63a0b95406191c86ba86ce6ed760c1f8ebfdc1013b516190ff5a6b0c6f43cfcf1d6b9e9c8a74577bfdec23fe2efe53e71337fc347ead1fec495ce6a9ceaeb332eff94db8c40e7b6557f1fa7010a8befddf68f3d7e5c8d92dc54e9ab8190f14ff9675c3ae6cb5468ec6eb0addbfe70b3cedc33bf7962cde26732c4d223e951c6b41c43db1bc2e78ff45aa1f9be36eaf829f942a0d07695fab9881e2358909fd56568726112853baa944dde45ada8d7f253dbb48745b6eef3d840e1991ddd4e752bfb3568edf95b16e768423dfee374f89e9ea43f44a3b5eb0d5159c9f81aa0f09893af2ad33d7b0be6d8d92efba567340f6d9a0ff5f23a1d2b70e96f060aa5fd7f5611a03086ebfc990afcc11e1f74da5e36ce085a8e575b8cab07bd5bab90ea0a335ac0242502856f72345b64de03121c7bffd387fb862987f19fcec985574e4def442b2b7dffe755c9095ab225bd597eff3a58a1c4c5df63a8a9e7f528d43f62ee961a96e887862396df755c3b6f0714f2df0e0cfb35f956a388256ffdf9b0751ef6ee55e9494d3e37a1e59de97fc38bde294280cd094953d0ebe2e429fa42695aa64cc1d918e21f1b16b8c99ffc270000ffff603a413108060000 -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01 ${CLI} send mix config vk -c 0 -z 1f8b08000000000000ff6c51795053eb15ff4e7281e0f086f5098ff7221114509692581441b4611111c160559055960b449280240842adb22b8bb2094a0551912aa853d08a452bd2a9a0b6022e55c74e519246a86804b57a04f47612c4ce74fad76fbeb3fc96efb0f509db97c96303186da533c449bbc5b2e4207a3730f90428007f600a09b00204c0946b910f4c2501235166bc449c10284bcf54c881a923842c640ad8006c9a2f98dd0096af1b30c50458be7c2d12e2c814b10158f4725d990d2c1f3760f61360f9f0bfa2408b84f09812dda060b60c2ca11b30a5045842be1609b1640e008081bf8496d23285aea70f1c4268a68c0de025576464262878b9bc8038a9342e844ee6c5cb04eecb5d0304c2a424b18cf6e2f9d112c5ff69f0f6cca604cedc2630070970e6c6b52f421631156c00cedc926e840510ae730bdb66330898436c00ee372b41bcc8e8af62fcff8a5512008020606a0921364c0d0bc0e47fe7b44d60aab5ba553add6ff5ea39ddd2595dedd7cc670eb3003891d17245865896acbd0d1811f285b261f2b55a141e0cb7b2cb5650edb824f244cad4c47a677cb79d9f3af5278f179fceaa06a59e13a140a1e16052f395a5279fe3dd5daf4b7c827f27c3965a8db9c42a568956cd1569b6966b34444bd656dd347cc6e1d5396c7655c9f5e679b762a85bf4d63b6dc6e3683e154f697e9d900d14662bd4cea71f769860daaf9e29ad7e5f4630708c2ffca3dbeb22341067b4bee93adfaa63fbebd588fb6b3f0812b1d1f042e1b5d6e66348d78f979ab3252a5cb8e831a97d193108149aced4bdfbe866f102b3cb9c573f3cd583b8c0a37d6fe391ad13e8c0bd292de84bc9224417f556fb83f4bb9ad17eec513f393a62b7f11e5e0d77e106e7d4cbd1f17ec1314596e21250382a6ee82e81db3cac1cbc6c5a6716f21794e839af0f2e6fb1409e1337356a91c24ce76e68ec3d377d7fad06472a2e5dfce870d1057d068523aedce275e812c95bb7e2674da78142faec8cc3631bcb30dc6cd9dd417ff75a0f9b2637ab0d0a6346d15594f45e31fac3351d5b8da5bd5cffb6d20377da08e61936c4b6a1cf1249596e8c4883662182ebde669272a030e7173762854fcda3d1652235ae6fbbe9306a869e4e9e3c7a60086d565c7137aec997135d58a030f183e9b0d71beb1cecf922d967b7ab780d3a58efda1059ff3210ad8397b9de342fb5060a6704ab948eaa497d0c88c813559e18106268cdcec20df6515de894f1a863ba6b8385cedf49ae6f9b5e627704ae2e6f5c5d3becf80a237f7c78e08972b0131dbb970ac63a0b95406191c86ba86ce6ed760c1f8ebfdc1013b516190ff5a6b0c6f43cfcf1d6b9e9c8a74577bfdec23fe2efe53e71337fc347ead1fec495ce6a9ceaeb332eff94db8c40e7b6557f1fa7010a8befddf68f3d7e5c8d92dc54e9ab8190f14ff9675c3ae6cb5468ec6eb0addbfe70b3cedc33bf7962cde26732c4d223e951c6b41c43db1bc2e78ff45aa1f9be36eaf829f942a0d07695fab9881e2358909fd56568726112853baa944dde45ada8d7f253dbb48745b6eef3d840e1991ddd4e752bfb3568edf95b16e768423dfee374f89e9ea43f44a3b5eb0d5159c9f81aa0f09893af2ad33d7b0be6d8d92efba567340f6d9a0ff5f23a1d2b70e96f060aa5fd7f5611a03086ebfc990afcc11e1f74da5e36ce085a8e575b8cab07bd5bab90ea0a335ac0242502856f72345b64de03121c7bffd387fb862987f19fcec985574e4def442b2b7dffe755c9095ab225bd597eff3a58a1c4c5df63a8a9e7f528d43f62ee961a96e887862396df755c3b6f0714f2df0e0cfb35f956a388256ffdf9b0751ef6ee55e9494d3e37a1e59de97fc38bde294280cd094953d0ebe2e429fa42695aa64cc1d918e21f1b16b8c99ffc270000ffff603a413108060000 -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01
...@@ -112,7 +114,7 @@ function mix_transfer() { ...@@ -112,7 +114,7 @@ function mix_transfer() {
function mix_deposit() { function mix_deposit() {
hash=$(${CLI} send mix deposit -m 1000000000 -p ./gnark/circuit/deposit/ -t 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -r 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01) hash=$(${CLI} send mix deposit -m 1000000000 -p ./gnark/circuit/deposit/ -r 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -f 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -e coins -s bty -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}" echo "${hash}"
query_tx "${CLI}" "${hash}" query_tx "${CLI}" "${hash}"
...@@ -124,7 +126,7 @@ function mix_deposit() { ...@@ -124,7 +126,7 @@ function mix_deposit() {
authHash=$(${MIX_CLI2} mix wallet notes -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -s 3 | jq -r ".notes[0].noteHash") authHash=$(${MIX_CLI2} mix wallet notes -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -s 3 | jq -r ".notes[0].noteHash")
authKey=$(${MIX_CLI2} mix wallet notes -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -s 3 | jq -r ".notes[0].secret.returnKey") authKey=$(${MIX_CLI2} mix wallet notes -a 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR -s 3 | jq -r ".notes[0].secret.returnKey")
echo "authHash=$authHash,authKey=$authKey" echo "authHash=$authHash,authKey=$authKey"
hash=$(${MIX_CLI2} send mix auth -n "$authHash" -a "$authKey" -p ./gnark/circuit/authorize/ -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01) hash=$(${MIX_CLI2} send mix auth -n "$authHash" -a "$authKey" -p ./gnark/circuit/authorize/ -e coins -s bty -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}" echo "${hash}"
query_tx "${MIX_CLI2}" "${hash}" query_tx "${MIX_CLI2}" "${hash}"
...@@ -132,7 +134,7 @@ function mix_deposit() { ...@@ -132,7 +134,7 @@ function mix_deposit() {
echo "transfer to 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k" echo "transfer to 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
transHash=$(${MIX_CLI1} mix wallet notes -a 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -s 1 | jq -r ".notes[0].noteHash") transHash=$(${MIX_CLI1} mix wallet notes -a 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 -s 1 | jq -r ".notes[0].noteHash")
hash=$(${MIX_CLI1} send mix transfer -m 600000000 -n "$transHash" -t 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -i ./gnark/circuit/transfer/input/ -o ./gnark/circuit/transfer/output/ -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01) hash=$(${MIX_CLI1} send mix transfer -m 600000000 -n "$transHash" -t 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -i ./gnark/circuit/transfer/input/ -o ./gnark/circuit/transfer/output/ -e coins -s bty -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}" echo "${hash}"
query_tx "${CLI}" "${hash}" query_tx "${CLI}" "${hash}"
...@@ -140,7 +142,7 @@ function mix_deposit() { ...@@ -140,7 +142,7 @@ function mix_deposit() {
echo "withdraw" echo "withdraw"
withdrawHash=$(${MIX_CLI3} mix wallet notes -a 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -s 1 | jq -r ".notes[0].noteHash") withdrawHash=$(${MIX_CLI3} mix wallet notes -a 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -s 1 | jq -r ".notes[0].noteHash")
hash=$(${MIX_CLI3} send mix withdraw -m 600000000 -n "$withdrawHash" -p ./gnark/circuit/withdraw/ -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115) hash=$(${MIX_CLI3} send mix withdraw -m 600000000 -n "$withdrawHash" -p ./gnark/circuit/withdraw/ -e coins -s bty -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115)
echo "${hash}" echo "${hash}"
query_tx "${CLI}" "${hash}" query_tx "${CLI}" "${hash}"
...@@ -155,6 +157,65 @@ function mix_deposit() { ...@@ -155,6 +157,65 @@ function mix_deposit() {
} }
function mix_token_test() {
echo "config token fee"
tokenAddr=$(${CLI} mix query txfee -e token -s GD | jq -r ".data")
echo "tokenAddr=$tokenAddr"
hash=$(${CLI} send coins transfer -a 10 -n transfer -t "$tokenAddr" -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
query_tx "${CLI}" "${hash}"
echo "token-blacklist"
hash=$(${CLI} send config config_tx -o add -c "token-blacklist" -v "BTY" -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
query_tx "${CLI}" "${hash}"
echo "precreate"
hash=$(${CLI} send token precreate -f 0.001 -i test -n guodunjifen -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -p 0 -s GD -t 10000 -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv)
echo "${hash}"
query_tx "${CLI}" "${hash}"
echo "finishcreate"
hash=$(${CLI} send token finish -f 0.001 -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -s GD -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv)
echo "${hash}"
query_tx "${CLI}" "${hash}"
${CLI} token created
echo "send_exec"
hash=$(${CLI} send token send_exec -a 100 -e mix -s GD -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv)
echo "${hash}"
query_tx "${CLI}" "${hash}"
echo "mix deposit"
hash=$(${CLI} send mix deposit -m 1000000000 -p ./gnark/circuit/deposit/ -r 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -e token -s GD -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
query_tx "${CLI}" "${hash}"
query_note "${MIX_CLI3}" 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k 1
echo "transfer to 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
transHash=$(${MIX_CLI3} mix wallet notes -a 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k -s 1 | jq -r ".notes[0].noteHash")
hash=$(${MIX_CLI3} send mix transfer -m 600000000 -n "$transHash" -t 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs -i ./gnark/circuit/transfer/input/ -o ./gnark/circuit/transfer/output/ -e token -s GD -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
query_tx "${CLI}" "${hash}"
query_note "${MIX_CLI3}" 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs 1
echo "withdraw token GD"
withdrawHash=$(${MIX_CLI3} mix wallet notes -a 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs -s 1 | jq -r ".notes[0].noteHash")
hash=$(${MIX_CLI3} send mix withdraw -m 600000000 -n "$withdrawHash" -p ./gnark/circuit/withdraw/ -e token -s GD -k 0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71)
echo "${hash}"
query_tx "${CLI}" "${hash}"
query_note "${MIX_CLI3}" 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs 2
${CLI} account balance -a 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs -e mix
balance=$(${CLI} asset balance -a 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs -e mix --asset_exec token --asset_symbol GD | jq -r ".balance")
if [ "${balance}" != "6.0000" ]; then
echo "account 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs should be 6.0000, real is $balance"
# exit 1
fi
}
function query_note() { function query_note() {
block_wait "${1}" 1 block_wait "${1}" 1
...@@ -201,6 +262,7 @@ function query_tx() { ...@@ -201,6 +262,7 @@ function query_tx() {
function mix_test() { function mix_test() {
echo "=========== # mix chain test =============" echo "=========== # mix chain test ============="
mix_deposit mix_deposit
mix_token_test
} }
function mix() { function mix() {
......
...@@ -205,9 +205,50 @@ func QueryCmd() *cobra.Command { ...@@ -205,9 +205,50 @@ func QueryCmd() *cobra.Command {
cmd.AddCommand(GetTreeStatusCmd()) cmd.AddCommand(GetTreeStatusCmd())
cmd.AddCommand(ShowMixTxsCmd()) cmd.AddCommand(ShowMixTxsCmd())
cmd.AddCommand(ShowPaymentPubKeyCmd()) cmd.AddCommand(ShowPaymentPubKeyCmd())
cmd.AddCommand(mixTokenTxFeeParaCmd())
return cmd return cmd
} }
func mixTokenTxFeeParaCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "txfee",
Short: "query token tx fee addr",
Run: createTokenTxFee,
}
addTokenTxFeeFlags(cmd)
return cmd
}
func addTokenTxFeeFlags(cmd *cobra.Command) {
cmd.Flags().StringP("exec", "e", "", "asset exec")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("symbol", "s", "", "asset symbol")
cmd.MarkFlagRequired("symbol")
}
func createTokenTxFee(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
exec, _ := cmd.Flags().GetString("exec")
symbol, _ := cmd.Flags().GetString("symbol")
var params rpctypes.Query4Jrpc
params.Execer = mixTy.MixX
params.FuncName = "TokenFeeAddr"
req := mixTy.TokenTxFee{
AssetExec: exec,
AssetSymbol: symbol,
}
params.Payload = types.MustPBToJSON(&req)
var res types.ReplyString
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.Query", params, &res)
ctx.Run()
}
// GetParaInfoCmd get para chain status by height // GetParaInfoCmd get para chain status by height
func GetTreePathCmd() *cobra.Command { func GetTreePathCmd() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
...@@ -225,19 +266,28 @@ func addGetPathCmdFlags(cmd *cobra.Command) { ...@@ -225,19 +266,28 @@ func addGetPathCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("leaf", "l", "", "leaf hash") cmd.Flags().StringP("leaf", "l", "", "leaf hash")
cmd.MarkFlagRequired("leaf") cmd.MarkFlagRequired("leaf")
cmd.Flags().StringP("exec", "e", "", "asset exec")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("symbol", "s", "", "asset symbol")
cmd.MarkFlagRequired("symbol")
} }
func treePath(cmd *cobra.Command, args []string) { func treePath(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
root, _ := cmd.Flags().GetString("root") root, _ := cmd.Flags().GetString("root")
leaf, _ := cmd.Flags().GetString("leaf") leaf, _ := cmd.Flags().GetString("leaf")
exec, _ := cmd.Flags().GetString("exec")
symbol, _ := cmd.Flags().GetString("symbol")
var params rpctypes.Query4Jrpc var params rpctypes.Query4Jrpc
params.Execer = mixTy.MixX params.Execer = mixTy.MixX
params.FuncName = "GetTreePath" params.FuncName = "GetTreePath"
req := mixTy.TreeInfoReq{ req := mixTy.TreeInfoReq{
RootHash: root, RootHash: root,
LeafHash: leaf, LeafHash: leaf,
AssetExec: exec,
AssetSymbol: symbol,
} }
params.Payload = types.MustPBToJSON(&req) params.Payload = types.MustPBToJSON(&req)
...@@ -260,17 +310,26 @@ func GetTreeLeavesCmd() *cobra.Command { ...@@ -260,17 +310,26 @@ func GetTreeLeavesCmd() *cobra.Command {
func addGetLeavesCmdFlags(cmd *cobra.Command) { func addGetLeavesCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("root", "r", "", "tree root hash, null means current leaves") cmd.Flags().StringP("root", "r", "", "tree root hash, null means current leaves")
cmd.Flags().StringP("exec", "e", "", "asset exec")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("symbol", "s", "", "asset symbol")
cmd.MarkFlagRequired("symbol")
} }
func treeLeaves(cmd *cobra.Command, args []string) { func treeLeaves(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
root, _ := cmd.Flags().GetString("root") root, _ := cmd.Flags().GetString("root")
exec, _ := cmd.Flags().GetString("exec")
symbol, _ := cmd.Flags().GetString("symbol")
var params rpctypes.Query4Jrpc var params rpctypes.Query4Jrpc
params.Execer = mixTy.MixX params.Execer = mixTy.MixX
params.FuncName = "GetLeavesList" params.FuncName = "GetLeavesList"
req := mixTy.TreeInfoReq{ req := mixTy.TreeInfoReq{
RootHash: root, RootHash: root,
AssetExec: exec,
AssetSymbol: symbol,
} }
params.Payload = types.MustPBToJSON(&req) params.Payload = types.MustPBToJSON(&req)
...@@ -291,20 +350,27 @@ func GetTreeRootsCmd() *cobra.Command { ...@@ -291,20 +350,27 @@ func GetTreeRootsCmd() *cobra.Command {
} }
func addGetRootsflags(cmd *cobra.Command) { func addGetRootsflags(cmd *cobra.Command) {
cmd.Flags().Int64P("seq", "s", 0, "sequence, default 0 is for current status") cmd.Flags().Uint64P("seq", "q", 0, "sequence, default 0 is for current status")
cmd.MarkFlagRequired("seq") cmd.MarkFlagRequired("seq")
cmd.Flags().StringP("exec", "e", "", "asset exec")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("symbol", "s", "", "asset symbol")
cmd.MarkFlagRequired("symbol")
} }
func treeRoot(cmd *cobra.Command, args []string) { func treeRoot(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
seq, _ := cmd.Flags().GetInt64("seq") seq, _ := cmd.Flags().GetUint64("seq")
exec, _ := cmd.Flags().GetString("exec")
symbol, _ := cmd.Flags().GetString("symbol")
var params rpctypes.Query4Jrpc var params rpctypes.Query4Jrpc
params.Execer = mixTy.MixX params.Execer = mixTy.MixX
params.FuncName = "GetRootList" params.FuncName = "GetRootList"
params.Payload = types.MustPBToJSON(&types.ReqInt{Height: seq}) params.Payload = types.MustPBToJSON(&mixTy.TreeInfoReq{RootHeight: seq, AssetExec: exec, AssetSymbol: symbol})
var res mixTy.RootListResp var res mixTy.RootListResp
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.Query", params, &res) ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.Query", params, &res)
...@@ -318,18 +384,28 @@ func GetTreeStatusCmd() *cobra.Command { ...@@ -318,18 +384,28 @@ func GetTreeStatusCmd() *cobra.Command {
Short: "Get commit leaves tree status", Short: "Get commit leaves tree status",
Run: treeStatus, Run: treeStatus,
} }
//addGetRootsflags(cmd) addGetTreeStatusflags(cmd)
return cmd return cmd
} }
func addGetTreeStatusflags(cmd *cobra.Command) {
cmd.Flags().StringP("exec", "e", "", "asset exec")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("symbol", "s", "", "asset symbol")
cmd.MarkFlagRequired("symbol")
}
func treeStatus(cmd *cobra.Command, args []string) { func treeStatus(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
exec, _ := cmd.Flags().GetString("exec")
symbol, _ := cmd.Flags().GetString("symbol")
var params rpctypes.Query4Jrpc var params rpctypes.Query4Jrpc
params.Execer = mixTy.MixX params.Execer = mixTy.MixX
params.FuncName = "GetTreeStatus" params.FuncName = "GetTreeStatus"
params.Payload = types.MustPBToJSON(&types.ReqNil{}) params.Payload = types.MustPBToJSON(&mixTy.TreeInfoReq{AssetExec: exec, AssetSymbol: symbol})
var res mixTy.TreeStatusResp var res mixTy.TreeStatusResp
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.Query", params, &res) ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.Query", params, &res)
...@@ -810,20 +886,24 @@ func CreateDepositRawTxCmd() *cobra.Command { ...@@ -810,20 +886,24 @@ func CreateDepositRawTxCmd() *cobra.Command {
} }
func depositSecretCmdFlags(cmd *cobra.Command) { func depositSecretCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("targets", "t", "", "target addrs,seperated by ','") cmd.Flags().StringP("receiver", "r", "", "receiver addrs,seperated by ','")
cmd.MarkFlagRequired("targets") cmd.MarkFlagRequired("receiver")
cmd.Flags().StringP("return", "r", "", "return addr,optional") cmd.Flags().StringP("return", "f", "", "return addr,optional")
cmd.Flags().StringP("authorize", "a", "", "authorize addr,optional") cmd.Flags().StringP("authorize", "a", "", "authorize addr,optional")
cmd.Flags().StringP("amount", "m", "", "amounts,seperated by ','") cmd.Flags().StringP("amount", "m", "", "amounts,seperated by ','")
cmd.MarkFlagRequired("amount") cmd.MarkFlagRequired("amount")
cmd.Flags().StringP("token", "s", "BTY", "asset token, default BTY") cmd.Flags().StringP("symbol", "s", "BTY", "asset symbol,like BTY")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins") cmd.MarkFlagRequired("symbol")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token)")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("path", "p", "", "deposit circuit path")
cmd.MarkFlagRequired("path")
cmd.Flags().StringP("path", "p", "", "deposit circuit path ")
cmd.Flags().Int32P("privacy", "w", 0, "get zk privacy data print, 1:print, default not") cmd.Flags().Int32P("privacy", "w", 0, "get zk privacy data print, 1:print, default not")
cmd.Flags().Int32P("verify", "v", 0, "verify on chain:0 on local:1, default 0 ") cmd.Flags().Int32P("verify", "v", 0, "verify on chain:0 on local:1, default 0 ")
...@@ -832,19 +912,19 @@ func depositSecretCmdFlags(cmd *cobra.Command) { ...@@ -832,19 +912,19 @@ func depositSecretCmdFlags(cmd *cobra.Command) {
func depositSecret(cmd *cobra.Command, args []string) { func depositSecret(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
paraName, _ := cmd.Flags().GetString("paraName") paraName, _ := cmd.Flags().GetString("paraName")
targets, _ := cmd.Flags().GetString("targets") receiver, _ := cmd.Flags().GetString("receiver")
returnAddr, _ := cmd.Flags().GetString("return") returnAddr, _ := cmd.Flags().GetString("return")
authorize, _ := cmd.Flags().GetString("authorize") authorize, _ := cmd.Flags().GetString("authorize")
amount, _ := cmd.Flags().GetString("amount") amount, _ := cmd.Flags().GetString("amount")
assetExec, _ := cmd.Flags().GetString("exec") assetExec, _ := cmd.Flags().GetString("exec")
token, _ := cmd.Flags().GetString("token") symbol, _ := cmd.Flags().GetString("symbol")
path, _ := cmd.Flags().GetString("path") path, _ := cmd.Flags().GetString("path")
privacy, _ := cmd.Flags().GetInt32("privacy") privacy, _ := cmd.Flags().GetInt32("privacy")
verify, _ := cmd.Flags().GetInt32("verify") verify, _ := cmd.Flags().GetInt32("verify")
deposit := &mixTy.DepositInfo{ deposit := &mixTy.DepositInfo{
ReceiverAddrs: targets, ReceiverAddrs: receiver,
ReturnAddr: returnAddr, ReturnAddr: returnAddr,
AuthorizeAddr: authorize, AuthorizeAddr: authorize,
Amounts: amount, Amounts: amount,
...@@ -856,13 +936,13 @@ func depositSecret(cmd *cobra.Command, args []string) { ...@@ -856,13 +936,13 @@ func depositSecret(cmd *cobra.Command, args []string) {
} }
params := &mixTy.CreateRawTxReq{ params := &mixTy.CreateRawTxReq{
ActionTy: mixTy.MixActionDeposit, ActionTy: mixTy.MixActionDeposit,
Data: types.Encode(tx), Data: types.Encode(tx),
AssetExec: assetExec, AssetExec: assetExec,
AssetToken: token, AssetSymbol: symbol,
Title: paraName, Title: paraName,
Privacy: privacy, Privacy: privacy,
Verify: verify, Verify: verify,
} }
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil) ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil)
...@@ -894,8 +974,10 @@ func transferSecretCmdFlags(cmd *cobra.Command) { ...@@ -894,8 +974,10 @@ func transferSecretCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("amount", "m", "", "transfer amount") cmd.Flags().StringP("amount", "m", "", "transfer amount")
cmd.MarkFlagRequired("amount") cmd.MarkFlagRequired("amount")
cmd.Flags().StringP("token", "s", "BTY", "asset token, default BTY") cmd.Flags().StringP("symbol", "s", "BTY", "asset token, like BTY")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins") cmd.MarkFlagRequired("symbol")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token)")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("inpath", "i", "", "input path ") cmd.Flags().StringP("inpath", "i", "", "input path ")
cmd.MarkFlagRequired("inpath") cmd.MarkFlagRequired("inpath")
...@@ -920,7 +1002,7 @@ func transferSecret(cmd *cobra.Command, args []string) { ...@@ -920,7 +1002,7 @@ func transferSecret(cmd *cobra.Command, args []string) {
outpath, _ := cmd.Flags().GetString("outpath") outpath, _ := cmd.Flags().GetString("outpath")
assetExec, _ := cmd.Flags().GetString("exec") assetExec, _ := cmd.Flags().GetString("exec")
token, _ := cmd.Flags().GetString("token") symbol, _ := cmd.Flags().GetString("symbol")
privacy, _ := cmd.Flags().GetInt32("privacy") privacy, _ := cmd.Flags().GetInt32("privacy")
verify, _ := cmd.Flags().GetInt32("verify") verify, _ := cmd.Flags().GetInt32("verify")
...@@ -948,13 +1030,13 @@ func transferSecret(cmd *cobra.Command, args []string) { ...@@ -948,13 +1030,13 @@ func transferSecret(cmd *cobra.Command, args []string) {
} }
params := &mixTy.CreateRawTxReq{ params := &mixTy.CreateRawTxReq{
ActionTy: mixTy.MixActionTransfer, ActionTy: mixTy.MixActionTransfer,
Data: types.Encode(req), Data: types.Encode(req),
AssetExec: assetExec, AssetExec: assetExec,
AssetToken: token, AssetSymbol: symbol,
Title: paraName, Title: paraName,
Privacy: privacy, Privacy: privacy,
Verify: verify, Verify: verify,
} }
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil) ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil)
...@@ -979,8 +1061,10 @@ func withdrawSecretCmdFlags(cmd *cobra.Command) { ...@@ -979,8 +1061,10 @@ func withdrawSecretCmdFlags(cmd *cobra.Command) {
cmd.Flags().Uint64P("amount", "m", 0, "total amount") cmd.Flags().Uint64P("amount", "m", 0, "total amount")
cmd.MarkFlagRequired("amount") cmd.MarkFlagRequired("amount")
cmd.Flags().StringP("token", "s", "BTY", "asset token, default BTY") cmd.Flags().StringP("symbol", "s", "BTY", "asset token, default BTY")
cmd.MarkFlagRequired("symbol")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins") cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("path", "p", "", "withdraw pk file ") cmd.Flags().StringP("path", "p", "", "withdraw pk file ")
cmd.MarkFlagRequired("path") cmd.MarkFlagRequired("path")
...@@ -997,7 +1081,7 @@ func withdrawSecret(cmd *cobra.Command, args []string) { ...@@ -997,7 +1081,7 @@ func withdrawSecret(cmd *cobra.Command, args []string) {
amount, _ := cmd.Flags().GetUint64("amount") amount, _ := cmd.Flags().GetUint64("amount")
assetExec, _ := cmd.Flags().GetString("exec") assetExec, _ := cmd.Flags().GetString("exec")
token, _ := cmd.Flags().GetString("token") symbol, _ := cmd.Flags().GetString("symbol")
path, _ := cmd.Flags().GetString("path") path, _ := cmd.Flags().GetString("path")
privacy, _ := cmd.Flags().GetInt32("privacy") privacy, _ := cmd.Flags().GetInt32("privacy")
...@@ -1010,13 +1094,13 @@ func withdrawSecret(cmd *cobra.Command, args []string) { ...@@ -1010,13 +1094,13 @@ func withdrawSecret(cmd *cobra.Command, args []string) {
} }
params := &mixTy.CreateRawTxReq{ params := &mixTy.CreateRawTxReq{
ActionTy: mixTy.MixActionWithdraw, ActionTy: mixTy.MixActionWithdraw,
Data: types.Encode(req), Data: types.Encode(req),
AssetExec: assetExec, AssetExec: assetExec,
AssetToken: token, AssetSymbol: symbol,
Title: paraName, Title: paraName,
Privacy: privacy, Privacy: privacy,
Verify: verify, Verify: verify,
} }
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil) ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil)
...@@ -1041,8 +1125,10 @@ func authSecretCmdFlags(cmd *cobra.Command) { ...@@ -1041,8 +1125,10 @@ func authSecretCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("toKey", "a", "", "authorize to key") cmd.Flags().StringP("toKey", "a", "", "authorize to key")
cmd.MarkFlagRequired("toKey") cmd.MarkFlagRequired("toKey")
cmd.Flags().StringP("token", "s", "BTY", "asset token, default BTY") cmd.Flags().StringP("symbol", "s", "BTY", "asset token, default BTY")
cmd.MarkFlagRequired("symbol")
cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins") cmd.Flags().StringP("exec", "e", "coins", "asset executor(coins, token, paracross), default coins")
cmd.MarkFlagRequired("exec")
cmd.Flags().StringP("path", "p", "", "auth path file ") cmd.Flags().StringP("path", "p", "", "auth path file ")
cmd.MarkFlagRequired("path") cmd.MarkFlagRequired("path")
...@@ -1059,7 +1145,7 @@ func authSecret(cmd *cobra.Command, args []string) { ...@@ -1059,7 +1145,7 @@ func authSecret(cmd *cobra.Command, args []string) {
toKey, _ := cmd.Flags().GetString("toKey") toKey, _ := cmd.Flags().GetString("toKey")
assetExec, _ := cmd.Flags().GetString("exec") assetExec, _ := cmd.Flags().GetString("exec")
token, _ := cmd.Flags().GetString("token") symbol, _ := cmd.Flags().GetString("symbol")
path, _ := cmd.Flags().GetString("path") path, _ := cmd.Flags().GetString("path")
...@@ -1073,13 +1159,13 @@ func authSecret(cmd *cobra.Command, args []string) { ...@@ -1073,13 +1159,13 @@ func authSecret(cmd *cobra.Command, args []string) {
} }
params := &mixTy.CreateRawTxReq{ params := &mixTy.CreateRawTxReq{
ActionTy: mixTy.MixActionAuth, ActionTy: mixTy.MixActionAuth,
Data: types.Encode(req), Data: types.Encode(req),
AssetExec: assetExec, AssetExec: assetExec,
AssetToken: token, AssetSymbol: symbol,
Title: paraName, Title: paraName,
Privacy: privacy, Privacy: privacy,
Verify: verify, Verify: verify,
} }
ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil) ctx := jsonclient.NewRPCCtx(rpcLaddr, "mix.CreateRawTransaction", params, nil)
......
...@@ -15,11 +15,11 @@ import ( ...@@ -15,11 +15,11 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
func (a *action) authParamCheck(input *mixTy.AuthorizePublicInput) error { func (a *action) authParamCheck(exec, symbol string, input *mixTy.AuthorizePublicInput) error {
//check tree rootHash exist //check tree rootHash exist
exist, err := checkTreeRootHashExist(a.db, mixTy.Str2Byte(input.TreeRootHash)) exist, err := checkTreeRootHashExist(a.db, exec, symbol, mixTy.Str2Byte(input.TreeRootHash))
if err != nil { if err != nil {
return errors.Wrapf(err, "roothash=%s not found", input.TreeRootHash) return errors.Wrapf(err, "roothash=%s not found,exec=%s,symbol=%s", input.TreeRootHash, exec, symbol)
} }
if !exist { if !exist {
return errors.Wrapf(mixTy.ErrTreeRootHashNotFound, "roothash=%s", input.TreeRootHash) return errors.Wrapf(mixTy.ErrTreeRootHashNotFound, "roothash=%s", input.TreeRootHash)
...@@ -54,7 +54,7 @@ func (a *action) authParamCheck(input *mixTy.AuthorizePublicInput) error { ...@@ -54,7 +54,7 @@ func (a *action) authParamCheck(input *mixTy.AuthorizePublicInput) error {
return nil return nil
} }
func (a *action) authorizeVerify(proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePublicInput, error) { func (a *action) authorizeVerify(exec, symbol string, proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePublicInput, error) {
var input mixTy.AuthorizePublicInput var input mixTy.AuthorizePublicInput
data, err := hex.DecodeString(proof.PublicInput) data, err := hex.DecodeString(proof.PublicInput)
if err != nil { if err != nil {
...@@ -65,7 +65,7 @@ func (a *action) authorizeVerify(proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePubl ...@@ -65,7 +65,7 @@ func (a *action) authorizeVerify(proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePubl
return nil, errors.Wrapf(err, "unmarshal string=%s", proof.PublicInput) return nil, errors.Wrapf(err, "unmarshal string=%s", proof.PublicInput)
} }
err = a.authParamCheck(&input) err = a.authParamCheck(exec, symbol, &input)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -90,7 +90,8 @@ func (a *action) authorizeVerify(proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePubl ...@@ -90,7 +90,8 @@ func (a *action) authorizeVerify(proof *mixTy.ZkProofInfo) (*mixTy.AuthorizePubl
func (a *action) Authorize(authorize *mixTy.MixAuthorizeAction) (*types.Receipt, error) { func (a *action) Authorize(authorize *mixTy.MixAuthorizeAction) (*types.Receipt, error) {
var inputs []*mixTy.AuthorizePublicInput var inputs []*mixTy.AuthorizePublicInput
in, err := a.authorizeVerify(authorize.Proof) execer, symbol := mixTy.GetAssetExecSymbol(a.api.GetConfig(), authorize.AssetExec, authorize.AssetSymbol)
in, err := a.authorizeVerify(execer, symbol, authorize.Proof)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -31,11 +31,13 @@ func getCommitLeaves(db dbm.KV, key []byte) (*mixTy.CommitTreeLeaves, error) { ...@@ -31,11 +31,13 @@ func getCommitLeaves(db dbm.KV, key []byte) (*mixTy.CommitTreeLeaves, error) {
return &leaves, nil return &leaves, nil
} }
func getCommitTreeStatus(db dbm.KV) (*mixTy.CommitTreeStatus, error) { func getCommitTreeStatus(db dbm.KV, assetExec, assetSymbol string) (*mixTy.CommitTreeStatus, error) {
v, err := db.Get(calcCommitTreeCurrentStatusKey()) v, err := db.Get(calcCommitTreeCurrentStatusKey(assetExec, assetSymbol))
if isNotFound(err) { if isNotFound(err) {
//系统初始化开始,没有任何状态,初始seq设为1,如果一个merkle树完成后,status清空状态,seq也要初始为1,作为数据库占位,不然会往前查找 //系统初始化开始,没有任何状态,初始seq设为1,如果一个merkle树完成后,status清空状态,seq也要初始为1,作为数据库占位,不然会往前查找
return &mixTy.CommitTreeStatus{ return &mixTy.CommitTreeStatus{
AssetExec: assetExec,
AssetSymbol: assetSymbol,
SubTrees: &mixTy.CommitSubTrees{}, SubTrees: &mixTy.CommitSubTrees{},
ArchiveRootsSeq: 1}, nil ArchiveRootsSeq: 1}, nil
} }
...@@ -52,10 +54,10 @@ func getCommitTreeStatus(db dbm.KV) (*mixTy.CommitTreeStatus, error) { ...@@ -52,10 +54,10 @@ func getCommitTreeStatus(db dbm.KV) (*mixTy.CommitTreeStatus, error) {
return &status, nil return &status, nil
} }
func getSubLeaves(db dbm.KV, currentSeq int32) (*mixTy.CommitTreeLeaves, error) { func getSubLeaves(db dbm.KV, exec, symbol string, currentSeq int32) (*mixTy.CommitTreeLeaves, error) {
var leaves mixTy.CommitTreeLeaves var leaves mixTy.CommitTreeLeaves
for i := int32(1); i <= currentSeq; i++ { for i := int32(1); i <= currentSeq; i++ {
l, err := getCommitLeaves(db, calcSubLeavesKey(i)) l, err := getCommitLeaves(db, calcSubLeavesKey(exec, symbol, i))
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getSubLeaves seq=%d", i) return nil, errors.Wrapf(err, "getSubLeaves seq=%d", i)
} }
...@@ -65,8 +67,8 @@ func getSubLeaves(db dbm.KV, currentSeq int32) (*mixTy.CommitTreeLeaves, error) ...@@ -65,8 +67,8 @@ func getSubLeaves(db dbm.KV, currentSeq int32) (*mixTy.CommitTreeLeaves, error)
return &leaves, nil return &leaves, nil
} }
func getCommitRootLeaves(db dbm.KV, rootHash string) (*mixTy.CommitTreeLeaves, error) { func getCommitRootLeaves(db dbm.KV, exec, symbol, rootHash string) (*mixTy.CommitTreeLeaves, error) {
return getCommitLeaves(db, calcCommitTreeRootLeaves(rootHash)) return getCommitLeaves(db, calcCommitTreeRootLeaves(exec, symbol, rootHash))
} }
func getCommitTreeRoots(db dbm.KV, key []byte) (*mixTy.CommitTreeRoots, error) { func getCommitTreeRoots(db dbm.KV, key []byte) (*mixTy.CommitTreeRoots, error) {
...@@ -83,12 +85,12 @@ func getCommitTreeRoots(db dbm.KV, key []byte) (*mixTy.CommitTreeRoots, error) { ...@@ -83,12 +85,12 @@ func getCommitTreeRoots(db dbm.KV, key []byte) (*mixTy.CommitTreeRoots, error) {
return &roots, nil return &roots, nil
} }
func getSubRoots(db dbm.KV, seq int32) (*mixTy.CommitTreeRoots, error) { func getSubRoots(db dbm.KV, exec, symbol string, seq int32) (*mixTy.CommitTreeRoots, error) {
return getCommitTreeRoots(db, calcSubRootsKey(seq)) return getCommitTreeRoots(db, calcSubRootsKey(exec, symbol, seq))
} }
func getArchiveRoots(db dbm.KV, seq uint64) (*mixTy.CommitTreeRoots, error) { func getArchiveRoots(db dbm.KV, exec, symbol string, seq uint64) (*mixTy.CommitTreeRoots, error) {
return getCommitTreeRoots(db, calcArchiveRootsKey(seq)) return getCommitTreeRoots(db, calcArchiveRootsKey(exec, symbol, seq))
} }
//TODO seed config //TODO seed config
...@@ -105,8 +107,8 @@ func calcTreeRoot(leaves *mixTy.CommitTreeLeaves) []byte { ...@@ -105,8 +107,8 @@ func calcTreeRoot(leaves *mixTy.CommitTreeLeaves) []byte {
} }
func makeArchiveRootReceipt(seq uint64, root string) *types.Receipt { func makeArchiveRootReceipt(exec, symbol string, seq uint64, root string) *types.Receipt {
key := calcArchiveRootsKey(seq) key := calcArchiveRootsKey(exec, symbol, seq)
log := &mixTy.ReceiptArchiveTreeRoot{ log := &mixTy.ReceiptArchiveTreeRoot{
RootHash: root, RootHash: root,
Seq: seq, Seq: seq,
...@@ -126,9 +128,9 @@ func makeArchiveRootReceipt(seq uint64, root string) *types.Receipt { ...@@ -126,9 +128,9 @@ func makeArchiveRootReceipt(seq uint64, root string) *types.Receipt {
} }
func makeArchiveLeavesReceipt(root string, leaves *mixTy.CommitTreeLeaves) *types.Receipt { func makeArchiveLeavesReceipt(exec, symbol, root string, leaves *mixTy.CommitTreeLeaves) *types.Receipt {
key := calcCommitTreeRootLeaves(root) key := calcCommitTreeRootLeaves(exec, symbol, root)
log := &mixTy.ReceiptArchiveLeaves{ log := &mixTy.ReceiptArchiveLeaves{
RootHash: root, RootHash: root,
Count: int32(len(leaves.Leaves)), Count: int32(len(leaves.Leaves)),
...@@ -148,8 +150,8 @@ func makeArchiveLeavesReceipt(root string, leaves *mixTy.CommitTreeLeaves) *type ...@@ -148,8 +150,8 @@ func makeArchiveLeavesReceipt(root string, leaves *mixTy.CommitTreeLeaves) *type
} }
func makeSubRootsReceipt(seq int32, root []byte) *types.Receipt { func makeSubRootsReceipt(exec, symbol string, seq int32, root []byte) *types.Receipt {
key := calcSubRootsKey(seq) key := calcSubRootsKey(exec, symbol, seq)
log := &mixTy.ReceiptCommitSubRoots{ log := &mixTy.ReceiptCommitSubRoots{
Seq: seq, Seq: seq,
Root: mixTy.Byte2Str(root), Root: mixTy.Byte2Str(root),
...@@ -168,8 +170,8 @@ func makeSubRootsReceipt(seq int32, root []byte) *types.Receipt { ...@@ -168,8 +170,8 @@ func makeSubRootsReceipt(seq int32, root []byte) *types.Receipt {
} }
func makeSubLeavesReceipt(seq int32, leaf []byte) *types.Receipt { func makeSubLeavesReceipt(exec, symbol string, seq int32, leaf []byte) *types.Receipt {
key := calcSubLeavesKey(seq) key := calcSubLeavesKey(exec, symbol, seq)
log := &mixTy.ReceiptCommitSubLeaves{ log := &mixTy.ReceiptCommitSubLeaves{
Seq: seq, Seq: seq,
Leaf: mixTy.Byte2Str(leaf), Leaf: mixTy.Byte2Str(leaf),
...@@ -188,8 +190,8 @@ func makeSubLeavesReceipt(seq int32, leaf []byte) *types.Receipt { ...@@ -188,8 +190,8 @@ func makeSubLeavesReceipt(seq int32, leaf []byte) *types.Receipt {
} }
func makeTreeStatusReceipt(prev, current *mixTy.CommitTreeStatus) *types.Receipt { func makeTreeStatusReceipt(exec, symbol string, prev, current *mixTy.CommitTreeStatus) *types.Receipt {
keyStatus := calcCommitTreeCurrentStatusKey() keyStatus := calcCommitTreeCurrentStatusKey(exec, symbol)
log := &mixTy.ReceiptCommitTreeStatus{ log := &mixTy.ReceiptCommitTreeStatus{
Prev: prev, Prev: prev,
Current: current, Current: current,
...@@ -210,11 +212,11 @@ func makeTreeStatusReceipt(prev, current *mixTy.CommitTreeStatus) *types.Receipt ...@@ -210,11 +212,11 @@ func makeTreeStatusReceipt(prev, current *mixTy.CommitTreeStatus) *types.Receipt
} }
func getArchivedSubLeaves(db dbm.KV) (*mixTy.CommitTreeLeaves, error) { func getArchivedSubLeaves(db dbm.KV, exec, symbol string, maxTreeLeaves int32) (*mixTy.CommitTreeLeaves, error) {
var leaves mixTy.CommitTreeLeaves var leaves mixTy.CommitTreeLeaves
//获取前1023个leaf //获取前1023个leaf
for i := int32(1); i < mixTy.MaxTreeLeaves; i++ { for i := int32(1); i < maxTreeLeaves; i++ {
r, err := getCommitLeaves(db, calcSubLeavesKey(i)) r, err := getCommitLeaves(db, calcSubLeavesKey(exec, symbol, i))
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getArchivedSubTreeLeaves,i=%d", i) return nil, errors.Wrapf(err, "getArchivedSubTreeLeaves,i=%d", i)
} }
...@@ -258,14 +260,14 @@ func joinSubTrees(status *mixTy.CommitTreeStatus, leaf []byte) ([]byte, error) { ...@@ -258,14 +260,14 @@ func joinSubTrees(status *mixTy.CommitTreeStatus, leaf []byte) ([]byte, error) {
} }
func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types.Receipt, error) { func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte, maxTreeLeaves int32) (*types.Receipt, error) {
receipts := &types.Receipt{Ty: types.ExecOk} receipts := &types.Receipt{Ty: types.ExecOk}
//seq从1开始记录前1023个叶子和root //seq从1开始记录前1023个叶子和root
if status.SubLeavesSeq < mixTy.MaxTreeLeaves { if status.SubLeavesSeq < maxTreeLeaves {
status.SubLeavesSeq++ status.SubLeavesSeq++
r := makeSubLeavesReceipt(status.SubLeavesSeq, leaf) r := makeSubLeavesReceipt(status.AssetExec, status.AssetSymbol, status.SubLeavesSeq, leaf)
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
//恢复并重新计算子树 //恢复并重新计算子树
...@@ -273,14 +275,14 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types. ...@@ -273,14 +275,14 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types.
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "joinLeaves.joinSubTrees") return nil, errors.Wrapf(err, "joinLeaves.joinSubTrees")
} }
r = makeSubRootsReceipt(status.SubLeavesSeq, root) r = makeSubRootsReceipt(status.AssetExec, status.AssetSymbol, status.SubLeavesSeq, root)
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
return receipts, nil return receipts, nil
} }
//累积到1024个叶子,需要归档 //累积到1024个叶子,需要归档
sumLeaves, err := getArchivedSubLeaves(db) sumLeaves, err := getArchivedSubLeaves(db, status.AssetExec, status.AssetSymbol, maxTreeLeaves)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "pushTree.joinLeaves") return nil, errors.Wrapf(err, "pushTree.joinLeaves")
} }
...@@ -289,11 +291,11 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types. ...@@ -289,11 +291,11 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types.
//重新计算1024个叶子root,确保正确 //重新计算1024个叶子root,确保正确
root := mixTy.Byte2Str(calcTreeRoot(sumLeaves)) root := mixTy.Byte2Str(calcTreeRoot(sumLeaves))
//root-leaves保存leaves //root-leaves保存leaves
r := makeArchiveLeavesReceipt(root, sumLeaves) r := makeArchiveLeavesReceipt(status.AssetExec, status.AssetSymbol, root, sumLeaves)
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
//1024叶子的root归档到相应archiveSeq //1024叶子的root归档到相应archiveSeq
r = makeArchiveRootReceipt(status.ArchiveRootsSeq, root) r = makeArchiveRootReceipt(status.AssetExec, status.AssetSymbol, status.ArchiveRootsSeq, root)
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
status.ArchiveRootsSeq++ status.ArchiveRootsSeq++
...@@ -309,8 +311,9 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types. ...@@ -309,8 +311,9 @@ func joinLeaves(db dbm.KV, status *mixTy.CommitTreeStatus, leaf []byte) (*types.
2. 如果leaves 达到最大比如1024,则按root归档leaves,并归档相应root 2. 如果leaves 达到最大比如1024,则按root归档leaves,并归档相应root
3. 归档同时初始化新的current leaves 和roots 3. 归档同时初始化新的current leaves 和roots
*/ */
func pushTree(db dbm.KV, leaves [][]byte) (*types.Receipt, error) { func pushTree(db dbm.KV, exec, symbol string, leaves [][]byte, maxTreeLeaves int32) (*types.Receipt, error) {
status, err := getCommitTreeStatus(db)
status, err := getCommitTreeStatus(db, exec, symbol)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -322,13 +325,13 @@ func pushTree(db dbm.KV, leaves [][]byte) (*types.Receipt, error) { ...@@ -322,13 +325,13 @@ func pushTree(db dbm.KV, leaves [][]byte) (*types.Receipt, error) {
if len(leaf) <= 0 { if len(leaf) <= 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "the %d leaf is null", i) return nil, errors.Wrapf(types.ErrInvalidParam, "the %d leaf is null", i)
} }
r, err := joinLeaves(db, status, leaf) r, err := joinLeaves(db, status, leaf, maxTreeLeaves)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "pushTree.joinLeaves leaf=%s", mixTy.Byte2Str(leaf)) return nil, errors.Wrapf(err, "pushTree.joinLeaves leaf=%s", mixTy.Byte2Str(leaf))
} }
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
} }
r := makeTreeStatusReceipt(prev, status) r := makeTreeStatusReceipt(exec, symbol, prev, status)
mergeReceipt(receipts, r) mergeReceipt(receipts, r)
return receipts, nil return receipts, nil
...@@ -343,15 +346,15 @@ func checkExist(target []byte, list [][]byte) bool { ...@@ -343,15 +346,15 @@ func checkExist(target []byte, list [][]byte) bool {
return false return false
} }
func checkTreeRootHashExist(db dbm.KV, hash []byte) (bool, error) { func checkTreeRootHashExist(db dbm.KV, exec, symbol string, hash []byte) (bool, error) {
status, err := getCommitTreeStatus(db) status, err := getCommitTreeStatus(db, exec, symbol)
if err != nil { if err != nil {
return false, errors.Wrapf(err, "checkTreeRootHashExist") return false, errors.Wrapf(err, "checkTreeRootHashExist")
} }
//查归档的subRoots,当前subSeq还未归档 //查归档的subRoots,当前subSeq还未归档
for i := int32(1); i <= status.SubLeavesSeq; i++ { for i := int32(1); i <= status.SubLeavesSeq; i++ {
subRoots, err := getSubRoots(db, i) subRoots, err := getSubRoots(db, exec, symbol, i)
if err != nil { if err != nil {
return false, errors.Wrapf(err, "checkTreeRootHashExist.getSubRoots seq=%d", i) return false, errors.Wrapf(err, "checkTreeRootHashExist.getSubRoots seq=%d", i)
} }
...@@ -362,7 +365,7 @@ func checkTreeRootHashExist(db dbm.KV, hash []byte) (bool, error) { ...@@ -362,7 +365,7 @@ func checkTreeRootHashExist(db dbm.KV, hash []byte) (bool, error) {
//再查归档的roots //再查归档的roots
for i := status.ArchiveRootsSeq; i > 0; i-- { for i := status.ArchiveRootsSeq; i > 0; i-- {
subRoots, err := getArchiveRoots(db, i) subRoots, err := getArchiveRoots(db, exec, symbol, i)
if err != nil { if err != nil {
return false, errors.Wrapf(err, "checkTreeRootHashExist.getArchiveRoots seq=%d", i) return false, errors.Wrapf(err, "checkTreeRootHashExist.getArchiveRoots seq=%d", i)
} }
...@@ -417,17 +420,17 @@ func getProveData(targetLeaf []byte, leaves [][]byte) (*mixTy.CommitTreeProve, e ...@@ -417,17 +420,17 @@ func getProveData(targetLeaf []byte, leaves [][]byte) (*mixTy.CommitTreeProve, e
//1. 首先在当前tree查找 //1. 首先在当前tree查找
//2. 如果提供了rootHash,则根据roothash+leaf查找,否则全局遍历查找 //2. 如果提供了rootHash,则根据roothash+leaf查找,否则全局遍历查找
func CalcTreeProve(db dbm.KV, rootHash, leaf string) (*mixTy.CommitTreeProve, error) { func CalcTreeProve(db dbm.KV, exec, symbol, rootHash, leaf string) (*mixTy.CommitTreeProve, error) {
if len(leaf) <= 0 { if len(leaf) <= 0 {
return nil, errors.Wrap(types.ErrInvalidParam, "leaf is null") return nil, errors.Wrap(types.ErrInvalidParam, "leaf is null")
} }
status, err := getCommitTreeStatus(db) status, err := getCommitTreeStatus(db, exec, symbol)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "CalcTreeProve.getCommitTreeStatus") return nil, errors.Wrapf(err, "CalcTreeProve.getCommitTreeStatus")
} }
leaves, err := getSubLeaves(db, status.SubLeavesSeq) leaves, err := getSubLeaves(db, exec, symbol, status.SubLeavesSeq)
if err == nil { if err == nil {
p, err := getProveData(mixTy.Str2Byte(leaf), leaves.Leaves) p, err := getProveData(mixTy.Str2Byte(leaf), leaves.Leaves)
if err == nil { if err == nil {
...@@ -436,7 +439,7 @@ func CalcTreeProve(db dbm.KV, rootHash, leaf string) (*mixTy.CommitTreeProve, er ...@@ -436,7 +439,7 @@ func CalcTreeProve(db dbm.KV, rootHash, leaf string) (*mixTy.CommitTreeProve, er
} }
if len(rootHash) > 0 { if len(rootHash) > 0 {
leaves, err := getCommitRootLeaves(db, rootHash) leaves, err := getCommitRootLeaves(db, exec, symbol, rootHash)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getCommitRootLeaves rootHash=%s", rootHash) return nil, errors.Wrapf(err, "getCommitRootLeaves rootHash=%s", rootHash)
} }
...@@ -449,8 +452,8 @@ func CalcTreeProve(db dbm.KV, rootHash, leaf string) (*mixTy.CommitTreeProve, er ...@@ -449,8 +452,8 @@ func CalcTreeProve(db dbm.KV, rootHash, leaf string) (*mixTy.CommitTreeProve, er
} }
for i := status.ArchiveRootsSeq; i > 0; i-- { for i := status.ArchiveRootsSeq; i > 0; i-- {
roots, err := getArchiveRoots(db, i) roots, err := getArchiveRoots(db, exec, symbol, i)
leaves, err := getCommitRootLeaves(db, mixTy.Byte2Str(roots.Roots[0])) leaves, err := getCommitRootLeaves(db, exec, symbol, mixTy.Byte2Str(roots.Roots[0]))
if err == nil { if err == nil {
p, err := getProveData(mixTy.Str2Byte(leaf), leaves.Leaves) p, err := getProveData(mixTy.Str2Byte(leaf), leaves.Leaves)
if err == nil { if err == nil {
......
...@@ -158,7 +158,7 @@ func (a *action) ConfigDeleteAuthPubKey(key string) (*types.Receipt, error) { ...@@ -158,7 +158,7 @@ func (a *action) ConfigDeleteAuthPubKey(key string) (*types.Receipt, error) {
} }
func makeConfigPaymentKeyReceipt(data *mixTy.PaymentKey) *types.Receipt { func makeConfigPaymentKeyReceipt(data *mixTy.PaymentKey) *types.Receipt {
key := getPaymentPubKey(data.Addr) key := calcReceivingKey(data.Addr)
return &types.Receipt{ return &types.Receipt{
Ty: types.ExecOk, Ty: types.ExecOk,
KV: []*types.KeyValue{ KV: []*types.KeyValue{
...@@ -172,7 +172,7 @@ func makeConfigPaymentKeyReceipt(data *mixTy.PaymentKey) *types.Receipt { ...@@ -172,7 +172,7 @@ func makeConfigPaymentKeyReceipt(data *mixTy.PaymentKey) *types.Receipt {
} }
func GetPaymentPubKey(db dbm.KV, addr string) (*mixTy.PaymentKey, error) { func GetPaymentPubKey(db dbm.KV, addr string) (*mixTy.PaymentKey, error) {
key := getPaymentPubKey(addr) key := calcReceivingKey(addr)
v, err := db.Get(key) v, err := db.Get(key)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "get db") return nil, errors.Wrapf(err, "get db")
......
...@@ -97,9 +97,10 @@ func (a *action) Deposit(deposit *mixTy.MixDepositAction) (*types.Receipt, error ...@@ -97,9 +97,10 @@ func (a *action) Deposit(deposit *mixTy.MixDepositAction) (*types.Receipt, error
//存款 //存款
cfg := a.api.GetConfig() cfg := a.api.GetConfig()
accoutDb, err := createAccount(cfg, "", "", a.db) execer, symbol := mixTy.GetAssetExecSymbol(cfg, deposit.AssetExec, deposit.AssetSymbol)
accoutDb, err := createAccount(cfg, execer, symbol, a.db)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "createAccount") return nil, errors.Wrapf(err, "createAccount,execer=%s,symbol=%s", execer, symbol)
} }
//主链上存入toAddr为mix 执行器地址,平行链上为user.p.{}.mix执行器地址,execAddr和toAddr一致 //主链上存入toAddr为mix 执行器地址,平行链上为user.p.{}.mix执行器地址,execAddr和toAddr一致
execAddr := address.ExecAddress(string(a.tx.Execer)) execAddr := address.ExecAddress(string(a.tx.Execer))
...@@ -112,7 +113,9 @@ func (a *action) Deposit(deposit *mixTy.MixDepositAction) (*types.Receipt, error ...@@ -112,7 +113,9 @@ func (a *action) Deposit(deposit *mixTy.MixDepositAction) (*types.Receipt, error
for _, n := range notes { for _, n := range notes {
leaves = append(leaves, mixTy.Str2Byte(n)) leaves = append(leaves, mixTy.Str2Byte(n))
} }
rpt, err := pushTree(a.db, leaves) conf := types.ConfSub(cfg, mixTy.MixX)
maxTreeLeaves := conf.GInt("maxTreeLeaves")
rpt, err := pushTree(a.db, execer, symbol, leaves, int32(maxTreeLeaves))
if err != nil { if err != nil {
return nil, errors.Wrap(err, "pushTree") return nil, errors.Wrap(err, "pushTree")
} }
......
...@@ -9,9 +9,9 @@ import ( ...@@ -9,9 +9,9 @@ import (
) )
var ( var (
verifyKeys string verifyKeys string
authPubKeys string authPubKeys string
paymentPubKey string receivingKey string
commitTreeCurrentStatus string commitTreeCurrentStatus string
commitTreeSubRoots string commitTreeSubRoots string
...@@ -27,7 +27,7 @@ var ( ...@@ -27,7 +27,7 @@ var (
func setPrefix() { func setPrefix() {
verifyKeys = "mavl-mix-verify-keys-" verifyKeys = "mavl-mix-verify-keys-"
authPubKeys = "mavl-mix-auth-pubkeys-" authPubKeys = "mavl-mix-auth-pubkeys-"
paymentPubKey = "mavl-mix-payment-pubkey-" receivingKey = "mavl-mix-receiving-key-"
commitTreeCurrentStatus = "mavl-mix-commitTree-current-status-" commitTreeCurrentStatus = "mavl-mix-commitTree-current-status-"
...@@ -51,28 +51,28 @@ func getAuthPubKeysKey() []byte { ...@@ -51,28 +51,28 @@ func getAuthPubKeysKey() []byte {
return []byte(fmt.Sprintf(authPubKeys)) return []byte(fmt.Sprintf(authPubKeys))
} }
func getPaymentPubKey(addr string) []byte { func calcReceivingKey(addr string) []byte {
return []byte(fmt.Sprintf(paymentPubKey+"%s", addr)) return []byte(fmt.Sprintf(receivingKey+"%s", addr))
} }
func calcCommitTreeCurrentStatusKey() []byte { func calcCommitTreeCurrentStatusKey(exec, symbol string) []byte {
return []byte(fmt.Sprintf(commitTreeCurrentStatus)) return []byte(fmt.Sprintf(commitTreeCurrentStatus+"%s-%s", exec, symbol))
} }
func calcArchiveRootsKey(seq uint64) []byte { func calcArchiveRootsKey(exec, symbol string, seq uint64) []byte {
return []byte(fmt.Sprintf(commitTreeArchiveRoots+"%022d", seq)) return []byte(fmt.Sprintf(commitTreeArchiveRoots+"%s-%s-%022d", exec, symbol, seq))
} }
func calcSubRootsKey(seq int32) []byte { func calcSubRootsKey(exec, symbol string, seq int32) []byte {
return []byte(fmt.Sprintf(commitTreeSubRoots+"%010d", seq)) return []byte(fmt.Sprintf(commitTreeSubRoots+"%s-%s-%010d", exec, symbol, seq))
} }
func calcSubLeavesKey(seq int32) []byte { func calcSubLeavesKey(exec, symbol string, seq int32) []byte {
return []byte(fmt.Sprintf(commitTreeSubLeaves+"%010d", seq)) return []byte(fmt.Sprintf(commitTreeSubLeaves+"%s-%s-%010d", exec, symbol, seq))
} }
func calcCommitTreeRootLeaves(rootHash string) []byte { func calcCommitTreeRootLeaves(exec, symbol string, rootHash string) []byte {
return []byte(fmt.Sprintf(commitTreeRootLeaves+"%s", rootHash)) return []byte(fmt.Sprintf(commitTreeRootLeaves+"%s-%s-%s", exec, symbol, rootHash))
} }
func calcAuthorizeHashKey(hash string) []byte { func calcAuthorizeHashKey(hash string) []byte {
......
...@@ -63,7 +63,8 @@ func (m *Mix) CheckTx(tx *types.Transaction, index int) error { ...@@ -63,7 +63,8 @@ func (m *Mix) CheckTx(tx *types.Transaction, index int) error {
// mix隐私交易,只私对私需要特殊签名验证 // mix隐私交易,只私对私需要特殊签名验证
return m.DriverBase.CheckTx(tx, index) return m.DriverBase.CheckTx(tx, index)
} }
_, _, err := MixTransferInfoVerify(m.GetStateDB(), action.GetTransfer())
_, _, err := MixTransferInfoVerify(m.GetAPI().GetConfig(), m.GetStateDB(), action.GetTransfer())
if err != nil { if err != nil {
mlog.Error("checkTx", "err", err, "txhash", common.ToHex(tx.Hash())) mlog.Error("checkTx", "err", err, "txhash", common.ToHex(tx.Hash()))
return err return err
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package executor package executor
import ( import (
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
mixTy "github.com/33cn/plugin/plugin/dapp/mix/types" mixTy "github.com/33cn/plugin/plugin/dapp/mix/types"
...@@ -16,7 +17,7 @@ func (m *Mix) Query_GetTreePath(in *mixTy.TreeInfoReq) (types.Message, error) { ...@@ -16,7 +17,7 @@ func (m *Mix) Query_GetTreePath(in *mixTy.TreeInfoReq) (types.Message, error) {
if in == nil { if in == nil {
return nil, types.ErrInvalidParam return nil, types.ErrInvalidParam
} }
return CalcTreeProve(m.GetStateDB(), in.RootHash, in.LeafHash) return CalcTreeProve(m.GetStateDB(), in.AssetExec, in.AssetSymbol, in.RootHash, in.LeafHash)
} }
// Query_GetTreeList query paracross title // Query_GetTreeList query paracross title
...@@ -27,18 +28,18 @@ func (m *Mix) Query_GetLeavesList(in *mixTy.TreeInfoReq) (types.Message, error) ...@@ -27,18 +28,18 @@ func (m *Mix) Query_GetLeavesList(in *mixTy.TreeInfoReq) (types.Message, error)
var leaves *mixTy.CommitTreeLeaves var leaves *mixTy.CommitTreeLeaves
if len(in.RootHash) > 0 { if len(in.RootHash) > 0 {
l, err := getCommitLeaves(m.GetStateDB(), calcCommitTreeRootLeaves(in.RootHash)) l, err := getCommitLeaves(m.GetStateDB(), calcCommitTreeRootLeaves(in.AssetExec, in.AssetSymbol, in.RootHash))
if err != nil { if err != nil {
return nil, err return nil, err
} }
leaves.Leaves = append(leaves.Leaves, l.Leaves...) leaves.Leaves = append(leaves.Leaves, l.Leaves...)
} else { } else {
status, err := getCommitTreeStatus(m.GetStateDB()) status, err := getCommitTreeStatus(m.GetStateDB(), in.AssetExec, in.AssetSymbol)
if err != nil { if err != nil {
return nil, err return nil, err
} }
for i := int32(1); i <= status.SubLeavesSeq; i++ { for i := int32(1); i <= status.SubLeavesSeq; i++ {
l, err := getCommitLeaves(m.GetStateDB(), calcSubLeavesKey(i)) l, err := getCommitLeaves(m.GetStateDB(), calcSubLeavesKey(in.AssetExec, in.AssetSymbol, i))
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "get leaves of seq=%d", i) return nil, errors.Wrapf(err, "get leaves of seq=%d", i)
} }
...@@ -57,21 +58,21 @@ func (m *Mix) Query_GetLeavesList(in *mixTy.TreeInfoReq) (types.Message, error) ...@@ -57,21 +58,21 @@ func (m *Mix) Query_GetLeavesList(in *mixTy.TreeInfoReq) (types.Message, error)
} }
// Query_GetRootList query title // Query_GetRootList query title
func (m *Mix) Query_GetRootList(in *types.ReqInt) (types.Message, error) { func (m *Mix) Query_GetRootList(in *mixTy.TreeInfoReq) (types.Message, error) {
var roots mixTy.CommitTreeRoots var roots mixTy.CommitTreeRoots
if in.Height > 0 { if in.RootHeight > 0 {
r, err := getArchiveRoots(m.GetStateDB(), uint64(in.Height)) r, err := getArchiveRoots(m.GetStateDB(), in.AssetExec, in.AssetSymbol, in.RootHeight)
if err != nil { if err != nil {
return nil, err return nil, err
} }
roots.Roots = append(roots.Roots, r.Roots...) roots.Roots = append(roots.Roots, r.Roots...)
} else { } else {
status, err := getCommitTreeStatus(m.GetStateDB()) status, err := getCommitTreeStatus(m.GetStateDB(), in.AssetExec, in.AssetSymbol)
if err != nil { if err != nil {
return nil, err return nil, err
} }
for i := int32(1); i <= status.SubLeavesSeq; i++ { for i := int32(1); i <= status.SubLeavesSeq; i++ {
r, err := getSubRoots(m.GetStateDB(), i) r, err := getSubRoots(m.GetStateDB(), in.AssetExec, in.AssetSymbol, i)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "get roots of seq=%d", i) return nil, errors.Wrapf(err, "get roots of seq=%d", i)
} }
...@@ -87,8 +88,8 @@ func (m *Mix) Query_GetRootList(in *types.ReqInt) (types.Message, error) { ...@@ -87,8 +88,8 @@ func (m *Mix) Query_GetRootList(in *types.ReqInt) (types.Message, error) {
return &resp, nil return &resp, nil
} }
func (m *Mix) Query_GetTreeStatus(in *types.ReqNil) (types.Message, error) { func (m *Mix) Query_GetTreeStatus(in *mixTy.TreeInfoReq) (types.Message, error) {
status, err := getCommitTreeStatus(m.GetStateDB()) status, err := getCommitTreeStatus(m.GetStateDB(), in.AssetExec, in.AssetSymbol)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -113,7 +114,16 @@ func (m *Mix) Query_PaymentPubKey(addr *types.ReqString) (types.Message, error) ...@@ -113,7 +114,16 @@ func (m *Mix) Query_PaymentPubKey(addr *types.ReqString) (types.Message, error)
} }
// Query_PaymentPubKey 批量查询 // Query_VerifyProof 批量查询
func (m *Mix) Query_VerifyProof(req *mixTy.VerifyProofInfo) (types.Message, error) { func (m *Mix) Query_VerifyProof(req *mixTy.VerifyProofInfo) (types.Message, error) {
return &types.ReqNil{}, zkProofVerify(m.GetStateDB(), req.Proof, req.Ty) return &types.ReqNil{}, zkProofVerify(m.GetStateDB(), req.Proof, req.Ty)
} }
// Query_TokenFeeAddr 私对私token转账,代扣地址查询, 需预先转账主代币到相应资产地址下面才能完成私对私的转账,代扣地址coins不能提回
func (m *Mix) Query_TokenFeeAddr(req *mixTy.TokenTxFee) (types.Message, error) {
if req == nil || len(req.AssetExec) == 0 || len(req.AssetSymbol) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "asset exec or symbol not filled")
}
return &types.ReplyString{Data: address.ExecAddress(mixTy.MixX + req.AssetExec + req.AssetSymbol)}, nil
}
...@@ -8,6 +8,8 @@ import ( ...@@ -8,6 +8,8 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
mixTy "github.com/33cn/plugin/plugin/dapp/mix/types" mixTy "github.com/33cn/plugin/plugin/dapp/mix/types"
"github.com/consensys/gurvy/bn256/twistededwards" "github.com/consensys/gurvy/bn256/twistededwards"
...@@ -21,7 +23,7 @@ import ( ...@@ -21,7 +23,7 @@ import (
2. check if exist in authorize pool and nullifier pool 2. check if exist in authorize pool and nullifier pool
*/ */
func transferInputVerify(db dbm.KV, proof *mixTy.ZkProofInfo) (*mixTy.TransferInputPublicInput, error) { func transferInputVerify(db dbm.KV, execer, symbol string, proof *mixTy.ZkProofInfo) (*mixTy.TransferInputPublicInput, error) {
var input mixTy.TransferInputPublicInput var input mixTy.TransferInputPublicInput
data, err := hex.DecodeString(proof.PublicInput) data, err := hex.DecodeString(proof.PublicInput)
if err != nil { if err != nil {
...@@ -32,7 +34,7 @@ func transferInputVerify(db dbm.KV, proof *mixTy.ZkProofInfo) (*mixTy.TransferIn ...@@ -32,7 +34,7 @@ func transferInputVerify(db dbm.KV, proof *mixTy.ZkProofInfo) (*mixTy.TransferIn
return nil, errors.Wrapf(err, "transferInput verify unmarshal string=%s", proof.PublicInput) return nil, errors.Wrapf(err, "transferInput verify unmarshal string=%s", proof.PublicInput)
} }
err = spendVerify(db, input.TreeRootHash, input.NullifierHash, input.AuthorizeSpendHash) err = spendVerify(db, execer, symbol, input.TreeRootHash, input.NullifierHash, input.AuthorizeSpendHash)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "transferInput verify spendVerify") return nil, errors.Wrap(err, "transferInput verify spendVerify")
} }
...@@ -71,7 +73,7 @@ func transferOutputVerify(db dbm.KV, proof *mixTy.ZkProofInfo) (*mixTy.TransferO ...@@ -71,7 +73,7 @@ func transferOutputVerify(db dbm.KV, proof *mixTy.ZkProofInfo) (*mixTy.TransferO
} }
func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mixTy.TransferOutputPublicInput) bool { func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mixTy.TransferOutputPublicInput, txFee uint64) bool {
var inputPoints, outputPoints []*twistededwards.Point var inputPoints, outputPoints []*twistededwards.Point
for _, in := range inputs { for _, in := range inputs {
var p twistededwards.Point var p twistededwards.Point
...@@ -89,7 +91,7 @@ func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mix ...@@ -89,7 +91,7 @@ func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mix
//out value add fee //out value add fee
//对于平行链来说, 隐私交易需要一个公共账户扣主链的手续费,隐私交易只需要扣平行链执行器内的费用即可 //对于平行链来说, 隐私交易需要一个公共账户扣主链的手续费,隐私交易只需要扣平行链执行器内的费用即可
//由于平行链的隐私交易没有实际扣平行链mix合约的手续费,平行链Mix合约会有手续费留下,平行链隐私可以考虑手续费为0 //由于平行链的隐私交易没有实际扣平行链mix合约的手续费,平行链Mix合约会有手续费留下,平行链隐私可以考虑手续费为0
outputPoints = append(outputPoints, mixTy.MulCurvePointG(uint64(mixTy.Privacy2PrivacyTxFee))) outputPoints = append(outputPoints, mixTy.MulCurvePointG(txFee))
//sum input and output //sum input and output
sumInput := inputPoints[0] sumInput := inputPoints[0]
...@@ -107,13 +109,15 @@ func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mix ...@@ -107,13 +109,15 @@ func VerifyCommitValues(inputs []*mixTy.TransferInputPublicInput, outputs []*mix
return false return false
} }
func MixTransferInfoVerify(db dbm.KV, transfer *mixTy.MixTransferAction) ([]*mixTy.TransferInputPublicInput, []*mixTy.TransferOutputPublicInput, error) { func MixTransferInfoVerify(cfg *types.Chain33Config, db dbm.KV, transfer *mixTy.MixTransferAction) ([]*mixTy.TransferInputPublicInput, []*mixTy.TransferOutputPublicInput, error) {
var inputs []*mixTy.TransferInputPublicInput var inputs []*mixTy.TransferInputPublicInput
var outputs []*mixTy.TransferOutputPublicInput var outputs []*mixTy.TransferOutputPublicInput
execer, symbol := mixTy.GetAssetExecSymbol(cfg, transfer.AssetExec, transfer.AssetSymbol)
txFee := mixTy.GetTransferTxFee(cfg, execer)
//inputs //inputs
for _, i := range transfer.Inputs { for _, i := range transfer.Inputs {
in, err := transferInputVerify(db, i) in, err := transferInputVerify(db, execer, symbol, i)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
...@@ -134,25 +138,63 @@ func MixTransferInfoVerify(db dbm.KV, transfer *mixTy.MixTransferAction) ([]*mix ...@@ -134,25 +138,63 @@ func MixTransferInfoVerify(db dbm.KV, transfer *mixTy.MixTransferAction) ([]*mix
} }
outputs = append(outputs, change) outputs = append(outputs, change)
if !VerifyCommitValues(inputs, outputs) { if !VerifyCommitValues(inputs, outputs, uint64(txFee)) {
return nil, nil, errors.Wrap(mixTy.ErrSpendInOutValueNotMatch, "verify shieldValue") return nil, nil, errors.Wrap(mixTy.ErrSpendInOutValueNotMatch, "verify shieldValue")
} }
return inputs, outputs, nil return inputs, outputs, nil
} }
//1. 如果
func (a *action) processTransferFee(exec, symbol string) (*types.Receipt, error) {
cfg := a.api.GetConfig()
accoutDb, err := createAccount(cfg, exec, symbol, a.db)
if err != nil {
return nil, err
}
txFee := mixTy.GetTransferTxFee(cfg, exec)
execAddr := address.ExecAddress(string(a.tx.Execer))
//需要mix执行器下的mix账户扣fee, 和mix 扣coins或token手续费保持一致,不然会看到mix的coins账户下和mix的mix账户下不一致
accFrom := accoutDb.LoadExecAccount(execAddr, execAddr)
if accFrom.GetBalance()-txFee >= 0 {
copyfrom := *accFrom
accFrom.Balance = accFrom.GetBalance() - txFee
receiptBalance := &types.ReceiptAccountTransfer{Prev: &copyfrom, Current: accFrom}
set := accoutDb.GetExecKVSet(execAddr, accFrom)
feelog := &types.ReceiptLog{Ty: types.TyLogFee, Log: types.Encode(receiptBalance)}
return &types.Receipt{
Ty: types.ExecOk,
KV: set,
Logs: append([]*types.ReceiptLog{}, feelog),
}, nil
}
return nil, types.ErrNoBalance
}
/* /*
1. verify(zk-proof, sum value of spend and new commits) 1. verify(zk-proof, sum value of spend and new commits)
2. check if exist in authorize pool and nullifier pool 2. check if exist in authorize pool and nullifier pool
3. add nullifier to pool 3. add nullifier to pool
*/ */
func (a *action) Transfer(transfer *mixTy.MixTransferAction) (*types.Receipt, error) { func (a *action) Transfer(transfer *mixTy.MixTransferAction) (*types.Receipt, error) {
inputs, outputs, err := MixTransferInfoVerify(a.db, transfer) inputs, outputs, err := MixTransferInfoVerify(a.api.GetConfig(), a.db, transfer)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "Transfer.MixTransferInfoVerify") return nil, errors.Wrap(err, "Transfer.MixTransferInfoVerify")
} }
receipt := &types.Receipt{Ty: types.ExecOk} receipt := &types.Receipt{Ty: types.ExecOk}
execer, symbol := mixTy.GetAssetExecSymbol(a.api.GetConfig(), transfer.AssetExec, transfer.AssetSymbol)
//扣除交易费
rTxFee, err := a.processTransferFee(execer, symbol)
if err != nil {
return nil, errors.Wrapf(err, "processTransferFee fail")
}
mergeReceipt(receipt, rTxFee)
for _, k := range inputs { for _, k := range inputs {
r := makeNullifierSetReceipt(k.NullifierHash, &mixTy.ExistValue{Nullifier: k.NullifierHash, Exist: true}) r := makeNullifierSetReceipt(k.NullifierHash, &mixTy.ExistValue{Nullifier: k.NullifierHash, Exist: true})
mergeReceipt(receipt, r) mergeReceipt(receipt, r)
...@@ -163,7 +205,10 @@ func (a *action) Transfer(transfer *mixTy.MixTransferAction) (*types.Receipt, er ...@@ -163,7 +205,10 @@ func (a *action) Transfer(transfer *mixTy.MixTransferAction) (*types.Receipt, er
for _, h := range outputs { for _, h := range outputs {
leaves = append(leaves, mixTy.Str2Byte(h.NoteHash)) leaves = append(leaves, mixTy.Str2Byte(h.NoteHash))
} }
rpt, err := pushTree(a.db, leaves)
conf := types.ConfSub(a.api.GetConfig(), mixTy.MixX)
maxTreeLeaves := conf.GInt("maxTreeLeaves")
rpt, err := pushTree(a.db, execer, symbol, leaves, int32(maxTreeLeaves))
if err != nil { if err != nil {
return nil, errors.Wrap(err, "transfer.pushTree") return nil, errors.Wrap(err, "transfer.pushTree")
} }
......
...@@ -16,10 +16,10 @@ import ( ...@@ -16,10 +16,10 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
func spendVerify(db dbm.KV, treeRootHash, nulliferHash, authorizeSpendHash string) error { func spendVerify(db dbm.KV, exec, symbol string, treeRootHash, nulliferHash, authorizeSpendHash string) error {
//zk-proof校验 //zk-proof校验
//check tree rootHash exist //check tree rootHash exist
exist, err := checkTreeRootHashExist(db, mixTy.Str2Byte(treeRootHash)) exist, err := checkTreeRootHashExist(db, exec, symbol, mixTy.Str2Byte(treeRootHash))
if err != nil { if err != nil {
return errors.Wrapf(err, "roothash=%s not found", treeRootHash) return errors.Wrapf(err, "roothash=%s not found", treeRootHash)
} }
...@@ -50,7 +50,7 @@ func spendVerify(db dbm.KV, treeRootHash, nulliferHash, authorizeSpendHash strin ...@@ -50,7 +50,7 @@ func spendVerify(db dbm.KV, treeRootHash, nulliferHash, authorizeSpendHash strin
} }
func (a *action) withdrawVerify(proof *mixTy.ZkProofInfo) (string, uint64, error) { func (a *action) withdrawVerify(exec, symbol string, proof *mixTy.ZkProofInfo) (string, uint64, error) {
var input mixTy.WithdrawPublicInput var input mixTy.WithdrawPublicInput
data, err := hex.DecodeString(proof.PublicInput) data, err := hex.DecodeString(proof.PublicInput)
if err != nil { if err != nil {
...@@ -65,7 +65,7 @@ func (a *action) withdrawVerify(proof *mixTy.ZkProofInfo) (string, uint64, error ...@@ -65,7 +65,7 @@ func (a *action) withdrawVerify(proof *mixTy.ZkProofInfo) (string, uint64, error
return "", 0, errors.Wrapf(err, "parseUint=%s", input.Amount) return "", 0, errors.Wrapf(err, "parseUint=%s", input.Amount)
} }
err = spendVerify(a.db, input.TreeRootHash, input.NullifierHash, input.AuthorizeSpendHash) err = spendVerify(a.db, exec, symbol, input.TreeRootHash, input.NullifierHash, input.AuthorizeSpendHash)
if err != nil { if err != nil {
return "", 0, err return "", 0, err
} }
...@@ -85,10 +85,12 @@ func (a *action) withdrawVerify(proof *mixTy.ZkProofInfo) (string, uint64, error ...@@ -85,10 +85,12 @@ func (a *action) withdrawVerify(proof *mixTy.ZkProofInfo) (string, uint64, error
3. set nullifier exist 3. set nullifier exist
*/ */
func (a *action) Withdraw(withdraw *mixTy.MixWithdrawAction) (*types.Receipt, error) { func (a *action) Withdraw(withdraw *mixTy.MixWithdrawAction) (*types.Receipt, error) {
exec, symbol := mixTy.GetAssetExecSymbol(a.api.GetConfig(), withdraw.AssetExec, withdraw.AssetSymbol)
var nulliferSet []string var nulliferSet []string
var sumValue uint64 var sumValue uint64
for _, k := range withdraw.Proofs { for _, k := range withdraw.Proofs {
nulfier, v, err := a.withdrawVerify(k) nulfier, v, err := a.withdrawVerify(exec, symbol, k)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -102,7 +104,7 @@ func (a *action) Withdraw(withdraw *mixTy.MixWithdrawAction) (*types.Receipt, er ...@@ -102,7 +104,7 @@ func (a *action) Withdraw(withdraw *mixTy.MixWithdrawAction) (*types.Receipt, er
//withdraw value //withdraw value
cfg := a.api.GetConfig() cfg := a.api.GetConfig()
accoutDb, err := createAccount(cfg, "", "", a.db) accoutDb, err := createAccount(cfg, exec, symbol, a.db)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -60,7 +60,8 @@ message MixConfigAction { ...@@ -60,7 +60,8 @@ message MixConfigAction {
oneof value { oneof value {
ZkVerifyKey verifyKey = 3; ZkVerifyKey verifyKey = 3;
string authKey = 4; string authKey = 4;
PaymentKey paymentKey = 5; PaymentKey paymentKey = 5;
} }
} }
...@@ -84,25 +85,34 @@ message ZkProofInfo { ...@@ -84,25 +85,34 @@ message ZkProofInfo {
} }
message MixDepositAction { message MixDepositAction {
repeated ZkProofInfo proofs = 1; string assetExec = 1;
string assetSymbol = 2;
repeated ZkProofInfo proofs = 3;
} }
message MixTransferAction { message MixTransferAction {
repeated ZkProofInfo inputs = 1; string assetExec = 1;
ZkProofInfo output = 2; string assetSymbol = 2;
ZkProofInfo change = 3; repeated ZkProofInfo inputs = 3;
ZkProofInfo output = 4;
ZkProofInfo change = 5;
} }
message MixWithdrawAction { message MixWithdrawAction {
uint64 amount = 1; string assetExec = 1;
repeated ZkProofInfo proofs = 2; string assetSymbol = 2;
uint64 amount = 3;
repeated ZkProofInfo proofs = 4;
} }
message MixAuthorizeAction { message MixAuthorizeAction {
ZkProofInfo proof = 1; string assetExec = 1;
string assetSymbol = 2;
ZkProofInfo proof = 3;
} }
...@@ -190,6 +200,8 @@ message CommitTreeStatus{ ...@@ -190,6 +200,8 @@ message CommitTreeStatus{
int32 subLeavesSeq = 2; int32 subLeavesSeq = 2;
//root的归档 从1开始,数据库占位,不然全空会往前搜索 //root的归档 从1开始,数据库占位,不然全空会往前搜索
uint64 archiveRootsSeq = 3; uint64 archiveRootsSeq = 3;
string assetExec = 4;
string assetSymbol = 5;
} }
...@@ -239,6 +251,9 @@ message CommitTreeProve { ...@@ -239,6 +251,9 @@ message CommitTreeProve {
message TreeInfoReq{ message TreeInfoReq{
string rootHash = 1; string rootHash = 1;
string leafHash = 2; string leafHash = 2;
string assetExec = 3;
string assetSymbol = 4;
uint64 rootHeight = 5;
} }
message TreeListResp{ message TreeListResp{
...@@ -295,6 +310,8 @@ message SecretData{ ...@@ -295,6 +310,8 @@ message SecretData{
string authorizeKey = 3; string authorizeKey = 3;
string amount = 4; string amount = 4;
string noteRandom = 5; string noteRandom = 5;
string assetExec = 6;
string assetSymbol = 7;
} }
...@@ -351,17 +368,6 @@ message WithdrawTxReq{ ...@@ -351,17 +368,6 @@ message WithdrawTxReq{
} }
message WithdrawProofRe{
SecretData secret = 1;
string nullifierHash = 2;
string authorizeSpendHash = 3;
string noteHash = 4;
string spendPrivKey = 5;
string spendFlag = 6;
string authorizeFlag = 7;
TreePathProof treeProof = 8;
}
//只授权一个note,超过一个,toAddr不好设置 //只授权一个note,超过一个,toAddr不好设置
message AuthTxReq{ message AuthTxReq{
...@@ -370,17 +376,6 @@ message AuthTxReq{ ...@@ -370,17 +376,6 @@ message AuthTxReq{
string zkPath = 4; string zkPath = 4;
} }
message AuthProofRe{
SecretData proof = 1;
string authPubKey = 2;
string authPrivKey = 3;
string authHash = 4;
string authorizeSpendHash = 5;
string noteHash = 6;
string spendFlag = 7;
TreePathProof treeProof = 8;
}
message TransferInputTxReq{ message TransferInputTxReq{
string noteHashs = 1; string noteHashs = 1;
...@@ -403,33 +398,7 @@ message ShieldAmount{ ...@@ -403,33 +398,7 @@ message ShieldAmount{
string Y = 2; string Y = 2;
} }
message TransferInputProof{
SecretData proof = 1;
string nullifierHash = 2;
string authorizeSpendHash = 3;
string noteHash = 4;
string spendPrivKey = 5;
string spendFlag = 6;
string authorizeFlag = 7;
TreePathProof treeProof = 8;
ShieldAmount shieldAmount = 9;
string amountRandom = 10;
}
message TransferOutputProof{
SecretData proof = 1;
string noteHash = 2;
DHSecretGroup secrets = 3;
ShieldAmount shieldAmount = 4;
string amountRandom = 5;
}
message TransferProofResp{
TransferInputProof transferInput = 1;
TransferOutputProof targetOutput = 2;
TransferOutputProof changeOutput = 3;
}
message ShieldAmountRst{ message ShieldAmountRst{
repeated string inputRandoms = 1; repeated string inputRandoms = 1;
...@@ -445,7 +414,7 @@ message CreateRawTxReq{ ...@@ -445,7 +414,7 @@ message CreateRawTxReq{
int32 actionTy = 1; int32 actionTy = 1;
bytes data = 4; bytes data = 4;
string assetExec = 2; string assetExec = 2;
string assetToken = 3; string assetSymbol = 3;
string title = 6; //平行链名字 string title = 6; //平行链名字
int32 privacy = 7; //1:打印隐私数据 int32 privacy = 7; //1:打印隐私数据
int32 verify = 8; //0:链上验证,1:本地验证 int32 verify = 8; //0:链上验证,1:本地验证
...@@ -476,6 +445,7 @@ message WalletNoteInfo { ...@@ -476,6 +445,7 @@ message WalletNoteInfo {
string authorizeHash = 4; string authorizeHash = 4;
string account = 5; //账户地址 string account = 5; //账户地址
NoteStatus status = 6; NoteStatus status = 6;
SecretData secret = 7; SecretData secret = 7;
} }
...@@ -487,14 +457,14 @@ message WalletDbMixInfo { ...@@ -487,14 +457,14 @@ message WalletDbMixInfo {
message WalletMixIndexReq { message WalletMixIndexReq {
string noteHash = 1; string noteHash = 1;
string nullifier = 2; string nullifier = 2;
string authorizeSpendHash = 3; string authorizeSpendHash = 3;
string authorizeHash = 4; string authorizeHash = 4;
string account = 5; string account = 5;
int32 status = 6; int32 status = 6;
int32 count = 7; int32 count = 7;
int32 direction = 8; int32 direction = 8;
} }
message WalletNoteResp { message WalletNoteResp {
......
...@@ -6,14 +6,13 @@ package types ...@@ -6,14 +6,13 @@ package types
import ( import (
"github.com/33cn/chain33/common/log/log15" "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
) )
var tlog = log15.New("module", MixX) var tlog = log15.New("module", MixX)
const ( const (
MaxTreeLeaves = 1024 //MaxTreeLeaves = 1024
TreeLevel = 10 TreeLevel = 10
) )
// 执行器的日志类型 // 执行器的日志类型
...@@ -45,15 +44,6 @@ const ( ...@@ -45,15 +44,6 @@ const (
MixActionAuth MixActionAuth
) )
//curve H point
const (
PointHX = "10190477835300927557649934238820360529458681672073866116232821892325659279502"
PointHY = "7969140283216448215269095418467361784159407896899334866715345504515077887397"
)
//mix transfer tx fee
const Privacy2PrivacyTxFee = types.Coin
//circuits default file name //circuits default file name
const ( const (
DepositCircuit = "circuit_deposit.r1cs" DepositCircuit = "circuit_deposit.r1cs"
......
...@@ -79,9 +79,10 @@ var MixConfigType_name = map[int32]string{ ...@@ -79,9 +79,10 @@ var MixConfigType_name = map[int32]string{
} }
var MixConfigType_value = map[string]int32{ var MixConfigType_value = map[string]int32{
"Verify": 0, "Verify": 0,
"Auth": 1, "Auth": 1,
"Payment": 2, "Payment": 2,
"TokenFee": 3,
} }
func (x MixConfigType) String() string { func (x MixConfigType) String() string {
...@@ -359,6 +360,61 @@ func (m *PaymentKey) GetEncryptKey() string { ...@@ -359,6 +360,61 @@ func (m *PaymentKey) GetEncryptKey() string {
return "" return ""
} }
type TokenTxFee struct {
AssetExec string `protobuf:"bytes,1,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,2,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TokenTxFee) Reset() { *m = TokenTxFee{} }
func (m *TokenTxFee) String() string { return proto.CompactTextString(m) }
func (*TokenTxFee) ProtoMessage() {}
func (*TokenTxFee) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{4}
}
func (m *TokenTxFee) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TokenTxFee.Unmarshal(m, b)
}
func (m *TokenTxFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TokenTxFee.Marshal(b, m, deterministic)
}
func (m *TokenTxFee) XXX_Merge(src proto.Message) {
xxx_messageInfo_TokenTxFee.Merge(m, src)
}
func (m *TokenTxFee) XXX_Size() int {
return xxx_messageInfo_TokenTxFee.Size(m)
}
func (m *TokenTxFee) XXX_DiscardUnknown() {
xxx_messageInfo_TokenTxFee.DiscardUnknown(m)
}
var xxx_messageInfo_TokenTxFee proto.InternalMessageInfo
func (m *TokenTxFee) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *TokenTxFee) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *TokenTxFee) GetAmount() uint64 {
if m != nil {
return m.Amount
}
return 0
}
//config verify parameter for proof //config verify parameter for proof
//当前authPk=mimc_hash(prikey),没有X,Y值 //当前authPk=mimc_hash(prikey),没有X,Y值
type MixConfigAction struct { type MixConfigAction struct {
...@@ -368,6 +424,7 @@ type MixConfigAction struct { ...@@ -368,6 +424,7 @@ type MixConfigAction struct {
// *MixConfigAction_VerifyKey // *MixConfigAction_VerifyKey
// *MixConfigAction_AuthKey // *MixConfigAction_AuthKey
// *MixConfigAction_PaymentKey // *MixConfigAction_PaymentKey
// *MixConfigAction_TokenFee
Value isMixConfigAction_Value `protobuf_oneof:"value"` Value isMixConfigAction_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
...@@ -378,7 +435,7 @@ func (m *MixConfigAction) Reset() { *m = MixConfigAction{} } ...@@ -378,7 +435,7 @@ func (m *MixConfigAction) Reset() { *m = MixConfigAction{} }
func (m *MixConfigAction) String() string { return proto.CompactTextString(m) } func (m *MixConfigAction) String() string { return proto.CompactTextString(m) }
func (*MixConfigAction) ProtoMessage() {} func (*MixConfigAction) ProtoMessage() {}
func (*MixConfigAction) Descriptor() ([]byte, []int) { func (*MixConfigAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{4} return fileDescriptor_5c21d519a9be369a, []int{5}
} }
func (m *MixConfigAction) XXX_Unmarshal(b []byte) error { func (m *MixConfigAction) XXX_Unmarshal(b []byte) error {
...@@ -429,12 +486,18 @@ type MixConfigAction_PaymentKey struct { ...@@ -429,12 +486,18 @@ type MixConfigAction_PaymentKey struct {
PaymentKey *PaymentKey `protobuf:"bytes,5,opt,name=paymentKey,proto3,oneof"` PaymentKey *PaymentKey `protobuf:"bytes,5,opt,name=paymentKey,proto3,oneof"`
} }
type MixConfigAction_TokenFee struct {
TokenFee *TokenTxFee `protobuf:"bytes,6,opt,name=tokenFee,proto3,oneof"`
}
func (*MixConfigAction_VerifyKey) isMixConfigAction_Value() {} func (*MixConfigAction_VerifyKey) isMixConfigAction_Value() {}
func (*MixConfigAction_AuthKey) isMixConfigAction_Value() {} func (*MixConfigAction_AuthKey) isMixConfigAction_Value() {}
func (*MixConfigAction_PaymentKey) isMixConfigAction_Value() {} func (*MixConfigAction_PaymentKey) isMixConfigAction_Value() {}
func (*MixConfigAction_TokenFee) isMixConfigAction_Value() {}
func (m *MixConfigAction) GetValue() isMixConfigAction_Value { func (m *MixConfigAction) GetValue() isMixConfigAction_Value {
if m != nil { if m != nil {
return m.Value return m.Value
...@@ -463,12 +526,20 @@ func (m *MixConfigAction) GetPaymentKey() *PaymentKey { ...@@ -463,12 +526,20 @@ func (m *MixConfigAction) GetPaymentKey() *PaymentKey {
return nil return nil
} }
func (m *MixConfigAction) GetTokenFee() *TokenTxFee {
if x, ok := m.GetValue().(*MixConfigAction_TokenFee); ok {
return x.TokenFee
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package. // XXX_OneofWrappers is for the internal use of the proto package.
func (*MixConfigAction) XXX_OneofWrappers() []interface{} { func (*MixConfigAction) XXX_OneofWrappers() []interface{} {
return []interface{}{ return []interface{}{
(*MixConfigAction_VerifyKey)(nil), (*MixConfigAction_VerifyKey)(nil),
(*MixConfigAction_AuthKey)(nil), (*MixConfigAction_AuthKey)(nil),
(*MixConfigAction_PaymentKey)(nil), (*MixConfigAction_PaymentKey)(nil),
(*MixConfigAction_TokenFee)(nil),
} }
} }
...@@ -485,7 +556,7 @@ func (m *DHSecret) Reset() { *m = DHSecret{} } ...@@ -485,7 +556,7 @@ func (m *DHSecret) Reset() { *m = DHSecret{} }
func (m *DHSecret) String() string { return proto.CompactTextString(m) } func (m *DHSecret) String() string { return proto.CompactTextString(m) }
func (*DHSecret) ProtoMessage() {} func (*DHSecret) ProtoMessage() {}
func (*DHSecret) Descriptor() ([]byte, []int) { func (*DHSecret) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{5} return fileDescriptor_5c21d519a9be369a, []int{6}
} }
func (m *DHSecret) XXX_Unmarshal(b []byte) error { func (m *DHSecret) XXX_Unmarshal(b []byte) error {
...@@ -534,7 +605,7 @@ func (m *DHSecretGroup) Reset() { *m = DHSecretGroup{} } ...@@ -534,7 +605,7 @@ func (m *DHSecretGroup) Reset() { *m = DHSecretGroup{} }
func (m *DHSecretGroup) String() string { return proto.CompactTextString(m) } func (m *DHSecretGroup) String() string { return proto.CompactTextString(m) }
func (*DHSecretGroup) ProtoMessage() {} func (*DHSecretGroup) ProtoMessage() {}
func (*DHSecretGroup) Descriptor() ([]byte, []int) { func (*DHSecretGroup) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{6} return fileDescriptor_5c21d519a9be369a, []int{7}
} }
func (m *DHSecretGroup) XXX_Unmarshal(b []byte) error { func (m *DHSecretGroup) XXX_Unmarshal(b []byte) error {
...@@ -589,7 +660,7 @@ func (m *ZkProofInfo) Reset() { *m = ZkProofInfo{} } ...@@ -589,7 +660,7 @@ func (m *ZkProofInfo) Reset() { *m = ZkProofInfo{} }
func (m *ZkProofInfo) String() string { return proto.CompactTextString(m) } func (m *ZkProofInfo) String() string { return proto.CompactTextString(m) }
func (*ZkProofInfo) ProtoMessage() {} func (*ZkProofInfo) ProtoMessage() {}
func (*ZkProofInfo) Descriptor() ([]byte, []int) { func (*ZkProofInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{7} return fileDescriptor_5c21d519a9be369a, []int{8}
} }
func (m *ZkProofInfo) XXX_Unmarshal(b []byte) error { func (m *ZkProofInfo) XXX_Unmarshal(b []byte) error {
...@@ -632,7 +703,9 @@ func (m *ZkProofInfo) GetSecrets() *DHSecretGroup { ...@@ -632,7 +703,9 @@ func (m *ZkProofInfo) GetSecrets() *DHSecretGroup {
} }
type MixDepositAction struct { type MixDepositAction struct {
Proofs []*ZkProofInfo `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty"` AssetExec string `protobuf:"bytes,1,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,2,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Proofs []*ZkProofInfo `protobuf:"bytes,3,rep,name=proofs,proto3" json:"proofs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -642,7 +715,7 @@ func (m *MixDepositAction) Reset() { *m = MixDepositAction{} } ...@@ -642,7 +715,7 @@ func (m *MixDepositAction) Reset() { *m = MixDepositAction{} }
func (m *MixDepositAction) String() string { return proto.CompactTextString(m) } func (m *MixDepositAction) String() string { return proto.CompactTextString(m) }
func (*MixDepositAction) ProtoMessage() {} func (*MixDepositAction) ProtoMessage() {}
func (*MixDepositAction) Descriptor() ([]byte, []int) { func (*MixDepositAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{8} return fileDescriptor_5c21d519a9be369a, []int{9}
} }
func (m *MixDepositAction) XXX_Unmarshal(b []byte) error { func (m *MixDepositAction) XXX_Unmarshal(b []byte) error {
...@@ -663,6 +736,20 @@ func (m *MixDepositAction) XXX_DiscardUnknown() { ...@@ -663,6 +736,20 @@ func (m *MixDepositAction) XXX_DiscardUnknown() {
var xxx_messageInfo_MixDepositAction proto.InternalMessageInfo var xxx_messageInfo_MixDepositAction proto.InternalMessageInfo
func (m *MixDepositAction) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *MixDepositAction) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *MixDepositAction) GetProofs() []*ZkProofInfo { func (m *MixDepositAction) GetProofs() []*ZkProofInfo {
if m != nil { if m != nil {
return m.Proofs return m.Proofs
...@@ -671,9 +758,11 @@ func (m *MixDepositAction) GetProofs() []*ZkProofInfo { ...@@ -671,9 +758,11 @@ func (m *MixDepositAction) GetProofs() []*ZkProofInfo {
} }
type MixTransferAction struct { type MixTransferAction struct {
Inputs []*ZkProofInfo `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` AssetExec string `protobuf:"bytes,1,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
Output *ZkProofInfo `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"` AssetSymbol string `protobuf:"bytes,2,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Change *ZkProofInfo `protobuf:"bytes,3,opt,name=change,proto3" json:"change,omitempty"` Inputs []*ZkProofInfo `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
Output *ZkProofInfo `protobuf:"bytes,4,opt,name=output,proto3" json:"output,omitempty"`
Change *ZkProofInfo `protobuf:"bytes,5,opt,name=change,proto3" json:"change,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -683,7 +772,7 @@ func (m *MixTransferAction) Reset() { *m = MixTransferAction{} } ...@@ -683,7 +772,7 @@ func (m *MixTransferAction) Reset() { *m = MixTransferAction{} }
func (m *MixTransferAction) String() string { return proto.CompactTextString(m) } func (m *MixTransferAction) String() string { return proto.CompactTextString(m) }
func (*MixTransferAction) ProtoMessage() {} func (*MixTransferAction) ProtoMessage() {}
func (*MixTransferAction) Descriptor() ([]byte, []int) { func (*MixTransferAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{9} return fileDescriptor_5c21d519a9be369a, []int{10}
} }
func (m *MixTransferAction) XXX_Unmarshal(b []byte) error { func (m *MixTransferAction) XXX_Unmarshal(b []byte) error {
...@@ -704,6 +793,20 @@ func (m *MixTransferAction) XXX_DiscardUnknown() { ...@@ -704,6 +793,20 @@ func (m *MixTransferAction) XXX_DiscardUnknown() {
var xxx_messageInfo_MixTransferAction proto.InternalMessageInfo var xxx_messageInfo_MixTransferAction proto.InternalMessageInfo
func (m *MixTransferAction) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *MixTransferAction) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *MixTransferAction) GetInputs() []*ZkProofInfo { func (m *MixTransferAction) GetInputs() []*ZkProofInfo {
if m != nil { if m != nil {
return m.Inputs return m.Inputs
...@@ -726,8 +829,10 @@ func (m *MixTransferAction) GetChange() *ZkProofInfo { ...@@ -726,8 +829,10 @@ func (m *MixTransferAction) GetChange() *ZkProofInfo {
} }
type MixWithdrawAction struct { type MixWithdrawAction struct {
Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` AssetExec string `protobuf:"bytes,1,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
Proofs []*ZkProofInfo `protobuf:"bytes,2,rep,name=proofs,proto3" json:"proofs,omitempty"` AssetSymbol string `protobuf:"bytes,2,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
Proofs []*ZkProofInfo `protobuf:"bytes,4,rep,name=proofs,proto3" json:"proofs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -737,7 +842,7 @@ func (m *MixWithdrawAction) Reset() { *m = MixWithdrawAction{} } ...@@ -737,7 +842,7 @@ func (m *MixWithdrawAction) Reset() { *m = MixWithdrawAction{} }
func (m *MixWithdrawAction) String() string { return proto.CompactTextString(m) } func (m *MixWithdrawAction) String() string { return proto.CompactTextString(m) }
func (*MixWithdrawAction) ProtoMessage() {} func (*MixWithdrawAction) ProtoMessage() {}
func (*MixWithdrawAction) Descriptor() ([]byte, []int) { func (*MixWithdrawAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{10} return fileDescriptor_5c21d519a9be369a, []int{11}
} }
func (m *MixWithdrawAction) XXX_Unmarshal(b []byte) error { func (m *MixWithdrawAction) XXX_Unmarshal(b []byte) error {
...@@ -758,6 +863,20 @@ func (m *MixWithdrawAction) XXX_DiscardUnknown() { ...@@ -758,6 +863,20 @@ func (m *MixWithdrawAction) XXX_DiscardUnknown() {
var xxx_messageInfo_MixWithdrawAction proto.InternalMessageInfo var xxx_messageInfo_MixWithdrawAction proto.InternalMessageInfo
func (m *MixWithdrawAction) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *MixWithdrawAction) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *MixWithdrawAction) GetAmount() uint64 { func (m *MixWithdrawAction) GetAmount() uint64 {
if m != nil { if m != nil {
return m.Amount return m.Amount
...@@ -773,7 +892,9 @@ func (m *MixWithdrawAction) GetProofs() []*ZkProofInfo { ...@@ -773,7 +892,9 @@ func (m *MixWithdrawAction) GetProofs() []*ZkProofInfo {
} }
type MixAuthorizeAction struct { type MixAuthorizeAction struct {
Proof *ZkProofInfo `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` AssetExec string `protobuf:"bytes,1,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,2,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Proof *ZkProofInfo `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -783,7 +904,7 @@ func (m *MixAuthorizeAction) Reset() { *m = MixAuthorizeAction{} } ...@@ -783,7 +904,7 @@ func (m *MixAuthorizeAction) Reset() { *m = MixAuthorizeAction{} }
func (m *MixAuthorizeAction) String() string { return proto.CompactTextString(m) } func (m *MixAuthorizeAction) String() string { return proto.CompactTextString(m) }
func (*MixAuthorizeAction) ProtoMessage() {} func (*MixAuthorizeAction) ProtoMessage() {}
func (*MixAuthorizeAction) Descriptor() ([]byte, []int) { func (*MixAuthorizeAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{11} return fileDescriptor_5c21d519a9be369a, []int{12}
} }
func (m *MixAuthorizeAction) XXX_Unmarshal(b []byte) error { func (m *MixAuthorizeAction) XXX_Unmarshal(b []byte) error {
...@@ -804,6 +925,20 @@ func (m *MixAuthorizeAction) XXX_DiscardUnknown() { ...@@ -804,6 +925,20 @@ func (m *MixAuthorizeAction) XXX_DiscardUnknown() {
var xxx_messageInfo_MixAuthorizeAction proto.InternalMessageInfo var xxx_messageInfo_MixAuthorizeAction proto.InternalMessageInfo
func (m *MixAuthorizeAction) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *MixAuthorizeAction) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *MixAuthorizeAction) GetProof() *ZkProofInfo { func (m *MixAuthorizeAction) GetProof() *ZkProofInfo {
if m != nil { if m != nil {
return m.Proof return m.Proof
...@@ -829,7 +964,7 @@ func (m *MixAction) Reset() { *m = MixAction{} } ...@@ -829,7 +964,7 @@ func (m *MixAction) Reset() { *m = MixAction{} }
func (m *MixAction) String() string { return proto.CompactTextString(m) } func (m *MixAction) String() string { return proto.CompactTextString(m) }
func (*MixAction) ProtoMessage() {} func (*MixAction) ProtoMessage() {}
func (*MixAction) Descriptor() ([]byte, []int) { func (*MixAction) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{12} return fileDescriptor_5c21d519a9be369a, []int{13}
} }
func (m *MixAction) XXX_Unmarshal(b []byte) error { func (m *MixAction) XXX_Unmarshal(b []byte) error {
...@@ -956,7 +1091,7 @@ func (m *DepositPublicInput) Reset() { *m = DepositPublicInput{} } ...@@ -956,7 +1091,7 @@ func (m *DepositPublicInput) Reset() { *m = DepositPublicInput{} }
func (m *DepositPublicInput) String() string { return proto.CompactTextString(m) } func (m *DepositPublicInput) String() string { return proto.CompactTextString(m) }
func (*DepositPublicInput) ProtoMessage() {} func (*DepositPublicInput) ProtoMessage() {}
func (*DepositPublicInput) Descriptor() ([]byte, []int) { func (*DepositPublicInput) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{13} return fileDescriptor_5c21d519a9be369a, []int{14}
} }
func (m *DepositPublicInput) XXX_Unmarshal(b []byte) error { func (m *DepositPublicInput) XXX_Unmarshal(b []byte) error {
...@@ -1005,7 +1140,7 @@ func (m *WithdrawPublicInput) Reset() { *m = WithdrawPublicInput{} } ...@@ -1005,7 +1140,7 @@ func (m *WithdrawPublicInput) Reset() { *m = WithdrawPublicInput{} }
func (m *WithdrawPublicInput) String() string { return proto.CompactTextString(m) } func (m *WithdrawPublicInput) String() string { return proto.CompactTextString(m) }
func (*WithdrawPublicInput) ProtoMessage() {} func (*WithdrawPublicInput) ProtoMessage() {}
func (*WithdrawPublicInput) Descriptor() ([]byte, []int) { func (*WithdrawPublicInput) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{14} return fileDescriptor_5c21d519a9be369a, []int{15}
} }
func (m *WithdrawPublicInput) XXX_Unmarshal(b []byte) error { func (m *WithdrawPublicInput) XXX_Unmarshal(b []byte) error {
...@@ -1069,7 +1204,7 @@ func (m *TransferInputPublicInput) Reset() { *m = TransferInputPublicInp ...@@ -1069,7 +1204,7 @@ func (m *TransferInputPublicInput) Reset() { *m = TransferInputPublicInp
func (m *TransferInputPublicInput) String() string { return proto.CompactTextString(m) } func (m *TransferInputPublicInput) String() string { return proto.CompactTextString(m) }
func (*TransferInputPublicInput) ProtoMessage() {} func (*TransferInputPublicInput) ProtoMessage() {}
func (*TransferInputPublicInput) Descriptor() ([]byte, []int) { func (*TransferInputPublicInput) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{15} return fileDescriptor_5c21d519a9be369a, []int{16}
} }
func (m *TransferInputPublicInput) XXX_Unmarshal(b []byte) error { func (m *TransferInputPublicInput) XXX_Unmarshal(b []byte) error {
...@@ -1138,7 +1273,7 @@ func (m *TransferOutputPublicInput) Reset() { *m = TransferOutputPublicI ...@@ -1138,7 +1273,7 @@ func (m *TransferOutputPublicInput) Reset() { *m = TransferOutputPublicI
func (m *TransferOutputPublicInput) String() string { return proto.CompactTextString(m) } func (m *TransferOutputPublicInput) String() string { return proto.CompactTextString(m) }
func (*TransferOutputPublicInput) ProtoMessage() {} func (*TransferOutputPublicInput) ProtoMessage() {}
func (*TransferOutputPublicInput) Descriptor() ([]byte, []int) { func (*TransferOutputPublicInput) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{16} return fileDescriptor_5c21d519a9be369a, []int{17}
} }
func (m *TransferOutputPublicInput) XXX_Unmarshal(b []byte) error { func (m *TransferOutputPublicInput) XXX_Unmarshal(b []byte) error {
...@@ -1194,7 +1329,7 @@ func (m *AuthorizePublicInput) Reset() { *m = AuthorizePublicInput{} } ...@@ -1194,7 +1329,7 @@ func (m *AuthorizePublicInput) Reset() { *m = AuthorizePublicInput{} }
func (m *AuthorizePublicInput) String() string { return proto.CompactTextString(m) } func (m *AuthorizePublicInput) String() string { return proto.CompactTextString(m) }
func (*AuthorizePublicInput) ProtoMessage() {} func (*AuthorizePublicInput) ProtoMessage() {}
func (*AuthorizePublicInput) Descriptor() ([]byte, []int) { func (*AuthorizePublicInput) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{17} return fileDescriptor_5c21d519a9be369a, []int{18}
} }
func (m *AuthorizePublicInput) XXX_Unmarshal(b []byte) error { func (m *AuthorizePublicInput) XXX_Unmarshal(b []byte) error {
...@@ -1255,7 +1390,7 @@ func (m *VerifyProofInfo) Reset() { *m = VerifyProofInfo{} } ...@@ -1255,7 +1390,7 @@ func (m *VerifyProofInfo) Reset() { *m = VerifyProofInfo{} }
func (m *VerifyProofInfo) String() string { return proto.CompactTextString(m) } func (m *VerifyProofInfo) String() string { return proto.CompactTextString(m) }
func (*VerifyProofInfo) ProtoMessage() {} func (*VerifyProofInfo) ProtoMessage() {}
func (*VerifyProofInfo) Descriptor() ([]byte, []int) { func (*VerifyProofInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{18} return fileDescriptor_5c21d519a9be369a, []int{19}
} }
func (m *VerifyProofInfo) XXX_Unmarshal(b []byte) error { func (m *VerifyProofInfo) XXX_Unmarshal(b []byte) error {
...@@ -1303,7 +1438,7 @@ func (m *ExistValue) Reset() { *m = ExistValue{} } ...@@ -1303,7 +1438,7 @@ func (m *ExistValue) Reset() { *m = ExistValue{} }
func (m *ExistValue) String() string { return proto.CompactTextString(m) } func (m *ExistValue) String() string { return proto.CompactTextString(m) }
func (*ExistValue) ProtoMessage() {} func (*ExistValue) ProtoMessage() {}
func (*ExistValue) Descriptor() ([]byte, []int) { func (*ExistValue) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{19} return fileDescriptor_5c21d519a9be369a, []int{20}
} }
func (m *ExistValue) XXX_Unmarshal(b []byte) error { func (m *ExistValue) XXX_Unmarshal(b []byte) error {
...@@ -1351,7 +1486,7 @@ func (m *CommitSubTree) Reset() { *m = CommitSubTree{} } ...@@ -1351,7 +1486,7 @@ func (m *CommitSubTree) Reset() { *m = CommitSubTree{} }
func (m *CommitSubTree) String() string { return proto.CompactTextString(m) } func (m *CommitSubTree) String() string { return proto.CompactTextString(m) }
func (*CommitSubTree) ProtoMessage() {} func (*CommitSubTree) ProtoMessage() {}
func (*CommitSubTree) Descriptor() ([]byte, []int) { func (*CommitSubTree) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{20} return fileDescriptor_5c21d519a9be369a, []int{21}
} }
func (m *CommitSubTree) XXX_Unmarshal(b []byte) error { func (m *CommitSubTree) XXX_Unmarshal(b []byte) error {
...@@ -1398,7 +1533,7 @@ func (m *CommitSubTrees) Reset() { *m = CommitSubTrees{} } ...@@ -1398,7 +1533,7 @@ func (m *CommitSubTrees) Reset() { *m = CommitSubTrees{} }
func (m *CommitSubTrees) String() string { return proto.CompactTextString(m) } func (m *CommitSubTrees) String() string { return proto.CompactTextString(m) }
func (*CommitSubTrees) ProtoMessage() {} func (*CommitSubTrees) ProtoMessage() {}
func (*CommitSubTrees) Descriptor() ([]byte, []int) { func (*CommitSubTrees) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{21} return fileDescriptor_5c21d519a9be369a, []int{22}
} }
func (m *CommitSubTrees) XXX_Unmarshal(b []byte) error { func (m *CommitSubTrees) XXX_Unmarshal(b []byte) error {
...@@ -1427,13 +1562,15 @@ func (m *CommitSubTrees) GetSubTrees() []*CommitSubTree { ...@@ -1427,13 +1562,15 @@ func (m *CommitSubTrees) GetSubTrees() []*CommitSubTree {
} }
//描述当前commitTree的状态 //描述当前commitTree的状态
//一颗merkel树1024叶子,考虑数据库读取原因,单个子树存8个叶子,分128次,待第128次时候归档,重新开始新的merkle树, //一颗merkel树1024叶子,考虑数据库读取原因,每个叶子都会存到相应seq db,待第1024次时候归档,重新开始新的merkle树,
type CommitTreeStatus struct { type CommitTreeStatus struct {
SubTrees *CommitSubTrees `protobuf:"bytes,1,opt,name=subTrees,proto3" json:"subTrees,omitempty"` SubTrees *CommitSubTrees `protobuf:"bytes,1,opt,name=subTrees,proto3" json:"subTrees,omitempty"`
//1~1024叶子的归档 //1~1024叶子的归档
SubLeavesSeq int32 `protobuf:"varint,2,opt,name=subLeavesSeq,proto3" json:"subLeavesSeq,omitempty"` SubLeavesSeq int32 `protobuf:"varint,2,opt,name=subLeavesSeq,proto3" json:"subLeavesSeq,omitempty"`
//root的归档 从1开始,数据库占位,不然全空会往前搜索 //root的归档 从1开始,数据库占位,不然全空会往前搜索
ArchiveRootsSeq uint64 `protobuf:"varint,3,opt,name=archiveRootsSeq,proto3" json:"archiveRootsSeq,omitempty"` ArchiveRootsSeq uint64 `protobuf:"varint,3,opt,name=archiveRootsSeq,proto3" json:"archiveRootsSeq,omitempty"`
AssetExec string `protobuf:"bytes,4,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,5,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -1443,7 +1580,7 @@ func (m *CommitTreeStatus) Reset() { *m = CommitTreeStatus{} } ...@@ -1443,7 +1580,7 @@ func (m *CommitTreeStatus) Reset() { *m = CommitTreeStatus{} }
func (m *CommitTreeStatus) String() string { return proto.CompactTextString(m) } func (m *CommitTreeStatus) String() string { return proto.CompactTextString(m) }
func (*CommitTreeStatus) ProtoMessage() {} func (*CommitTreeStatus) ProtoMessage() {}
func (*CommitTreeStatus) Descriptor() ([]byte, []int) { func (*CommitTreeStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{22} return fileDescriptor_5c21d519a9be369a, []int{23}
} }
func (m *CommitTreeStatus) XXX_Unmarshal(b []byte) error { func (m *CommitTreeStatus) XXX_Unmarshal(b []byte) error {
...@@ -1485,6 +1622,20 @@ func (m *CommitTreeStatus) GetArchiveRootsSeq() uint64 { ...@@ -1485,6 +1622,20 @@ func (m *CommitTreeStatus) GetArchiveRootsSeq() uint64 {
return 0 return 0
} }
func (m *CommitTreeStatus) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *CommitTreeStatus) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
type ReceiptCommitTreeStatus struct { type ReceiptCommitTreeStatus struct {
Prev *CommitTreeStatus `protobuf:"bytes,1,opt,name=prev,proto3" json:"prev,omitempty"` Prev *CommitTreeStatus `protobuf:"bytes,1,opt,name=prev,proto3" json:"prev,omitempty"`
Current *CommitTreeStatus `protobuf:"bytes,2,opt,name=current,proto3" json:"current,omitempty"` Current *CommitTreeStatus `protobuf:"bytes,2,opt,name=current,proto3" json:"current,omitempty"`
...@@ -1497,7 +1648,7 @@ func (m *ReceiptCommitTreeStatus) Reset() { *m = ReceiptCommitTreeStatus ...@@ -1497,7 +1648,7 @@ func (m *ReceiptCommitTreeStatus) Reset() { *m = ReceiptCommitTreeStatus
func (m *ReceiptCommitTreeStatus) String() string { return proto.CompactTextString(m) } func (m *ReceiptCommitTreeStatus) String() string { return proto.CompactTextString(m) }
func (*ReceiptCommitTreeStatus) ProtoMessage() {} func (*ReceiptCommitTreeStatus) ProtoMessage() {}
func (*ReceiptCommitTreeStatus) Descriptor() ([]byte, []int) { func (*ReceiptCommitTreeStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{23} return fileDescriptor_5c21d519a9be369a, []int{24}
} }
func (m *ReceiptCommitTreeStatus) XXX_Unmarshal(b []byte) error { func (m *ReceiptCommitTreeStatus) XXX_Unmarshal(b []byte) error {
...@@ -1544,7 +1695,7 @@ func (m *ReceiptCommitSubLeaves) Reset() { *m = ReceiptCommitSubLeaves{} ...@@ -1544,7 +1695,7 @@ func (m *ReceiptCommitSubLeaves) Reset() { *m = ReceiptCommitSubLeaves{}
func (m *ReceiptCommitSubLeaves) String() string { return proto.CompactTextString(m) } func (m *ReceiptCommitSubLeaves) String() string { return proto.CompactTextString(m) }
func (*ReceiptCommitSubLeaves) ProtoMessage() {} func (*ReceiptCommitSubLeaves) ProtoMessage() {}
func (*ReceiptCommitSubLeaves) Descriptor() ([]byte, []int) { func (*ReceiptCommitSubLeaves) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{24} return fileDescriptor_5c21d519a9be369a, []int{25}
} }
func (m *ReceiptCommitSubLeaves) XXX_Unmarshal(b []byte) error { func (m *ReceiptCommitSubLeaves) XXX_Unmarshal(b []byte) error {
...@@ -1591,7 +1742,7 @@ func (m *ReceiptCommitSubRoots) Reset() { *m = ReceiptCommitSubRoots{} } ...@@ -1591,7 +1742,7 @@ func (m *ReceiptCommitSubRoots) Reset() { *m = ReceiptCommitSubRoots{} }
func (m *ReceiptCommitSubRoots) String() string { return proto.CompactTextString(m) } func (m *ReceiptCommitSubRoots) String() string { return proto.CompactTextString(m) }
func (*ReceiptCommitSubRoots) ProtoMessage() {} func (*ReceiptCommitSubRoots) ProtoMessage() {}
func (*ReceiptCommitSubRoots) Descriptor() ([]byte, []int) { func (*ReceiptCommitSubRoots) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{25} return fileDescriptor_5c21d519a9be369a, []int{26}
} }
func (m *ReceiptCommitSubRoots) XXX_Unmarshal(b []byte) error { func (m *ReceiptCommitSubRoots) XXX_Unmarshal(b []byte) error {
...@@ -1639,7 +1790,7 @@ func (m *ReceiptArchiveLeaves) Reset() { *m = ReceiptArchiveLeaves{} } ...@@ -1639,7 +1790,7 @@ func (m *ReceiptArchiveLeaves) Reset() { *m = ReceiptArchiveLeaves{} }
func (m *ReceiptArchiveLeaves) String() string { return proto.CompactTextString(m) } func (m *ReceiptArchiveLeaves) String() string { return proto.CompactTextString(m) }
func (*ReceiptArchiveLeaves) ProtoMessage() {} func (*ReceiptArchiveLeaves) ProtoMessage() {}
func (*ReceiptArchiveLeaves) Descriptor() ([]byte, []int) { func (*ReceiptArchiveLeaves) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{26} return fileDescriptor_5c21d519a9be369a, []int{27}
} }
func (m *ReceiptArchiveLeaves) XXX_Unmarshal(b []byte) error { func (m *ReceiptArchiveLeaves) XXX_Unmarshal(b []byte) error {
...@@ -1693,7 +1844,7 @@ func (m *ReceiptArchiveTreeRoot) Reset() { *m = ReceiptArchiveTreeRoot{} ...@@ -1693,7 +1844,7 @@ func (m *ReceiptArchiveTreeRoot) Reset() { *m = ReceiptArchiveTreeRoot{}
func (m *ReceiptArchiveTreeRoot) String() string { return proto.CompactTextString(m) } func (m *ReceiptArchiveTreeRoot) String() string { return proto.CompactTextString(m) }
func (*ReceiptArchiveTreeRoot) ProtoMessage() {} func (*ReceiptArchiveTreeRoot) ProtoMessage() {}
func (*ReceiptArchiveTreeRoot) Descriptor() ([]byte, []int) { func (*ReceiptArchiveTreeRoot) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{27} return fileDescriptor_5c21d519a9be369a, []int{28}
} }
func (m *ReceiptArchiveTreeRoot) XXX_Unmarshal(b []byte) error { func (m *ReceiptArchiveTreeRoot) XXX_Unmarshal(b []byte) error {
...@@ -1739,7 +1890,7 @@ func (m *CommitTreeLeaves) Reset() { *m = CommitTreeLeaves{} } ...@@ -1739,7 +1890,7 @@ func (m *CommitTreeLeaves) Reset() { *m = CommitTreeLeaves{} }
func (m *CommitTreeLeaves) String() string { return proto.CompactTextString(m) } func (m *CommitTreeLeaves) String() string { return proto.CompactTextString(m) }
func (*CommitTreeLeaves) ProtoMessage() {} func (*CommitTreeLeaves) ProtoMessage() {}
func (*CommitTreeLeaves) Descriptor() ([]byte, []int) { func (*CommitTreeLeaves) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{28} return fileDescriptor_5c21d519a9be369a, []int{29}
} }
func (m *CommitTreeLeaves) XXX_Unmarshal(b []byte) error { func (m *CommitTreeLeaves) XXX_Unmarshal(b []byte) error {
...@@ -1778,7 +1929,7 @@ func (m *CommitTreeRoots) Reset() { *m = CommitTreeRoots{} } ...@@ -1778,7 +1929,7 @@ func (m *CommitTreeRoots) Reset() { *m = CommitTreeRoots{} }
func (m *CommitTreeRoots) String() string { return proto.CompactTextString(m) } func (m *CommitTreeRoots) String() string { return proto.CompactTextString(m) }
func (*CommitTreeRoots) ProtoMessage() {} func (*CommitTreeRoots) ProtoMessage() {}
func (*CommitTreeRoots) Descriptor() ([]byte, []int) { func (*CommitTreeRoots) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{29} return fileDescriptor_5c21d519a9be369a, []int{30}
} }
func (m *CommitTreeRoots) XXX_Unmarshal(b []byte) error { func (m *CommitTreeRoots) XXX_Unmarshal(b []byte) error {
...@@ -1821,7 +1972,7 @@ func (m *CommitTreeProve) Reset() { *m = CommitTreeProve{} } ...@@ -1821,7 +1972,7 @@ func (m *CommitTreeProve) Reset() { *m = CommitTreeProve{} }
func (m *CommitTreeProve) String() string { return proto.CompactTextString(m) } func (m *CommitTreeProve) String() string { return proto.CompactTextString(m) }
func (*CommitTreeProve) ProtoMessage() {} func (*CommitTreeProve) ProtoMessage() {}
func (*CommitTreeProve) Descriptor() ([]byte, []int) { func (*CommitTreeProve) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{30} return fileDescriptor_5c21d519a9be369a, []int{31}
} }
func (m *CommitTreeProve) XXX_Unmarshal(b []byte) error { func (m *CommitTreeProve) XXX_Unmarshal(b []byte) error {
...@@ -1880,6 +2031,9 @@ func (m *CommitTreeProve) GetHelpers() []uint32 { ...@@ -1880,6 +2031,9 @@ func (m *CommitTreeProve) GetHelpers() []uint32 {
type TreeInfoReq struct { type TreeInfoReq struct {
RootHash string `protobuf:"bytes,1,opt,name=rootHash,proto3" json:"rootHash,omitempty"` RootHash string `protobuf:"bytes,1,opt,name=rootHash,proto3" json:"rootHash,omitempty"`
LeafHash string `protobuf:"bytes,2,opt,name=leafHash,proto3" json:"leafHash,omitempty"` LeafHash string `protobuf:"bytes,2,opt,name=leafHash,proto3" json:"leafHash,omitempty"`
AssetExec string `protobuf:"bytes,3,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,4,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
RootHeight uint64 `protobuf:"varint,5,opt,name=rootHeight,proto3" json:"rootHeight,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -1889,7 +2043,7 @@ func (m *TreeInfoReq) Reset() { *m = TreeInfoReq{} } ...@@ -1889,7 +2043,7 @@ func (m *TreeInfoReq) Reset() { *m = TreeInfoReq{} }
func (m *TreeInfoReq) String() string { return proto.CompactTextString(m) } func (m *TreeInfoReq) String() string { return proto.CompactTextString(m) }
func (*TreeInfoReq) ProtoMessage() {} func (*TreeInfoReq) ProtoMessage() {}
func (*TreeInfoReq) Descriptor() ([]byte, []int) { func (*TreeInfoReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{31} return fileDescriptor_5c21d519a9be369a, []int{32}
} }
func (m *TreeInfoReq) XXX_Unmarshal(b []byte) error { func (m *TreeInfoReq) XXX_Unmarshal(b []byte) error {
...@@ -1924,6 +2078,27 @@ func (m *TreeInfoReq) GetLeafHash() string { ...@@ -1924,6 +2078,27 @@ func (m *TreeInfoReq) GetLeafHash() string {
return "" return ""
} }
func (m *TreeInfoReq) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *TreeInfoReq) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func (m *TreeInfoReq) GetRootHeight() uint64 {
if m != nil {
return m.RootHeight
}
return 0
}
type TreeListResp struct { type TreeListResp struct {
Leaves []string `protobuf:"bytes,1,rep,name=leaves,proto3" json:"leaves,omitempty"` Leaves []string `protobuf:"bytes,1,rep,name=leaves,proto3" json:"leaves,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
...@@ -1935,7 +2110,7 @@ func (m *TreeListResp) Reset() { *m = TreeListResp{} } ...@@ -1935,7 +2110,7 @@ func (m *TreeListResp) Reset() { *m = TreeListResp{} }
func (m *TreeListResp) String() string { return proto.CompactTextString(m) } func (m *TreeListResp) String() string { return proto.CompactTextString(m) }
func (*TreeListResp) ProtoMessage() {} func (*TreeListResp) ProtoMessage() {}
func (*TreeListResp) Descriptor() ([]byte, []int) { func (*TreeListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{32} return fileDescriptor_5c21d519a9be369a, []int{33}
} }
func (m *TreeListResp) XXX_Unmarshal(b []byte) error { func (m *TreeListResp) XXX_Unmarshal(b []byte) error {
...@@ -1974,7 +2149,7 @@ func (m *RootListResp) Reset() { *m = RootListResp{} } ...@@ -1974,7 +2149,7 @@ func (m *RootListResp) Reset() { *m = RootListResp{} }
func (m *RootListResp) String() string { return proto.CompactTextString(m) } func (m *RootListResp) String() string { return proto.CompactTextString(m) }
func (*RootListResp) ProtoMessage() {} func (*RootListResp) ProtoMessage() {}
func (*RootListResp) Descriptor() ([]byte, []int) { func (*RootListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{33} return fileDescriptor_5c21d519a9be369a, []int{34}
} }
func (m *RootListResp) XXX_Unmarshal(b []byte) error { func (m *RootListResp) XXX_Unmarshal(b []byte) error {
...@@ -2014,7 +2189,7 @@ func (m *SubTreeResp) Reset() { *m = SubTreeResp{} } ...@@ -2014,7 +2189,7 @@ func (m *SubTreeResp) Reset() { *m = SubTreeResp{} }
func (m *SubTreeResp) String() string { return proto.CompactTextString(m) } func (m *SubTreeResp) String() string { return proto.CompactTextString(m) }
func (*SubTreeResp) ProtoMessage() {} func (*SubTreeResp) ProtoMessage() {}
func (*SubTreeResp) Descriptor() ([]byte, []int) { func (*SubTreeResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{34} return fileDescriptor_5c21d519a9be369a, []int{35}
} }
func (m *SubTreeResp) XXX_Unmarshal(b []byte) error { func (m *SubTreeResp) XXX_Unmarshal(b []byte) error {
...@@ -2062,7 +2237,7 @@ func (m *TreeStatusResp) Reset() { *m = TreeStatusResp{} } ...@@ -2062,7 +2237,7 @@ func (m *TreeStatusResp) Reset() { *m = TreeStatusResp{} }
func (m *TreeStatusResp) String() string { return proto.CompactTextString(m) } func (m *TreeStatusResp) String() string { return proto.CompactTextString(m) }
func (*TreeStatusResp) ProtoMessage() {} func (*TreeStatusResp) ProtoMessage() {}
func (*TreeStatusResp) Descriptor() ([]byte, []int) { func (*TreeStatusResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{35} return fileDescriptor_5c21d519a9be369a, []int{36}
} }
func (m *TreeStatusResp) XXX_Unmarshal(b []byte) error { func (m *TreeStatusResp) XXX_Unmarshal(b []byte) error {
...@@ -2118,7 +2293,7 @@ func (m *PaymentKeyPair) Reset() { *m = PaymentKeyPair{} } ...@@ -2118,7 +2293,7 @@ func (m *PaymentKeyPair) Reset() { *m = PaymentKeyPair{} }
func (m *PaymentKeyPair) String() string { return proto.CompactTextString(m) } func (m *PaymentKeyPair) String() string { return proto.CompactTextString(m) }
func (*PaymentKeyPair) ProtoMessage() {} func (*PaymentKeyPair) ProtoMessage() {}
func (*PaymentKeyPair) Descriptor() ([]byte, []int) { func (*PaymentKeyPair) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{36} return fileDescriptor_5c21d519a9be369a, []int{37}
} }
func (m *PaymentKeyPair) XXX_Unmarshal(b []byte) error { func (m *PaymentKeyPair) XXX_Unmarshal(b []byte) error {
...@@ -2168,7 +2343,7 @@ func (m *EncryptKeyPair) Reset() { *m = EncryptKeyPair{} } ...@@ -2168,7 +2343,7 @@ func (m *EncryptKeyPair) Reset() { *m = EncryptKeyPair{} }
func (m *EncryptKeyPair) String() string { return proto.CompactTextString(m) } func (m *EncryptKeyPair) String() string { return proto.CompactTextString(m) }
func (*EncryptKeyPair) ProtoMessage() {} func (*EncryptKeyPair) ProtoMessage() {}
func (*EncryptKeyPair) Descriptor() ([]byte, []int) { func (*EncryptKeyPair) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{37} return fileDescriptor_5c21d519a9be369a, []int{38}
} }
func (m *EncryptKeyPair) XXX_Unmarshal(b []byte) error { func (m *EncryptKeyPair) XXX_Unmarshal(b []byte) error {
...@@ -2217,7 +2392,7 @@ func (m *AccountPrivacyKey) Reset() { *m = AccountPrivacyKey{} } ...@@ -2217,7 +2392,7 @@ func (m *AccountPrivacyKey) Reset() { *m = AccountPrivacyKey{} }
func (m *AccountPrivacyKey) String() string { return proto.CompactTextString(m) } func (m *AccountPrivacyKey) String() string { return proto.CompactTextString(m) }
func (*AccountPrivacyKey) ProtoMessage() {} func (*AccountPrivacyKey) ProtoMessage() {}
func (*AccountPrivacyKey) Descriptor() ([]byte, []int) { func (*AccountPrivacyKey) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{38} return fileDescriptor_5c21d519a9be369a, []int{39}
} }
func (m *AccountPrivacyKey) XXX_Unmarshal(b []byte) error { func (m *AccountPrivacyKey) XXX_Unmarshal(b []byte) error {
...@@ -2264,7 +2439,7 @@ func (m *WalletAddrPrivacy) Reset() { *m = WalletAddrPrivacy{} } ...@@ -2264,7 +2439,7 @@ func (m *WalletAddrPrivacy) Reset() { *m = WalletAddrPrivacy{} }
func (m *WalletAddrPrivacy) String() string { return proto.CompactTextString(m) } func (m *WalletAddrPrivacy) String() string { return proto.CompactTextString(m) }
func (*WalletAddrPrivacy) ProtoMessage() {} func (*WalletAddrPrivacy) ProtoMessage() {}
func (*WalletAddrPrivacy) Descriptor() ([]byte, []int) { func (*WalletAddrPrivacy) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{39} return fileDescriptor_5c21d519a9be369a, []int{40}
} }
func (m *WalletAddrPrivacy) XXX_Unmarshal(b []byte) error { func (m *WalletAddrPrivacy) XXX_Unmarshal(b []byte) error {
...@@ -2305,6 +2480,8 @@ type SecretData struct { ...@@ -2305,6 +2480,8 @@ type SecretData struct {
AuthorizeKey string `protobuf:"bytes,3,opt,name=authorizeKey,proto3" json:"authorizeKey,omitempty"` AuthorizeKey string `protobuf:"bytes,3,opt,name=authorizeKey,proto3" json:"authorizeKey,omitempty"`
Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"`
NoteRandom string `protobuf:"bytes,5,opt,name=noteRandom,proto3" json:"noteRandom,omitempty"` NoteRandom string `protobuf:"bytes,5,opt,name=noteRandom,proto3" json:"noteRandom,omitempty"`
AssetExec string `protobuf:"bytes,6,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetSymbol string `protobuf:"bytes,7,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -2314,7 +2491,7 @@ func (m *SecretData) Reset() { *m = SecretData{} } ...@@ -2314,7 +2491,7 @@ func (m *SecretData) Reset() { *m = SecretData{} }
func (m *SecretData) String() string { return proto.CompactTextString(m) } func (m *SecretData) String() string { return proto.CompactTextString(m) }
func (*SecretData) ProtoMessage() {} func (*SecretData) ProtoMessage() {}
func (*SecretData) Descriptor() ([]byte, []int) { func (*SecretData) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{40} return fileDescriptor_5c21d519a9be369a, []int{41}
} }
func (m *SecretData) XXX_Unmarshal(b []byte) error { func (m *SecretData) XXX_Unmarshal(b []byte) error {
...@@ -2370,6 +2547,20 @@ func (m *SecretData) GetNoteRandom() string { ...@@ -2370,6 +2547,20 @@ func (m *SecretData) GetNoteRandom() string {
return "" return ""
} }
func (m *SecretData) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *SecretData) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
type EncryptSecretData struct { type EncryptSecretData struct {
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
PeerKey string `protobuf:"bytes,2,opt,name=peerKey,proto3" json:"peerKey,omitempty"` PeerKey string `protobuf:"bytes,2,opt,name=peerKey,proto3" json:"peerKey,omitempty"`
...@@ -2382,7 +2573,7 @@ func (m *EncryptSecretData) Reset() { *m = EncryptSecretData{} } ...@@ -2382,7 +2573,7 @@ func (m *EncryptSecretData) Reset() { *m = EncryptSecretData{} }
func (m *EncryptSecretData) String() string { return proto.CompactTextString(m) } func (m *EncryptSecretData) String() string { return proto.CompactTextString(m) }
func (*EncryptSecretData) ProtoMessage() {} func (*EncryptSecretData) ProtoMessage() {}
func (*EncryptSecretData) Descriptor() ([]byte, []int) { func (*EncryptSecretData) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{41} return fileDescriptor_5c21d519a9be369a, []int{42}
} }
func (m *EncryptSecretData) XXX_Unmarshal(b []byte) error { func (m *EncryptSecretData) XXX_Unmarshal(b []byte) error {
...@@ -2430,7 +2621,7 @@ func (m *DecryptSecretData) Reset() { *m = DecryptSecretData{} } ...@@ -2430,7 +2621,7 @@ func (m *DecryptSecretData) Reset() { *m = DecryptSecretData{} }
func (m *DecryptSecretData) String() string { return proto.CompactTextString(m) } func (m *DecryptSecretData) String() string { return proto.CompactTextString(m) }
func (*DecryptSecretData) ProtoMessage() {} func (*DecryptSecretData) ProtoMessage() {}
func (*DecryptSecretData) Descriptor() ([]byte, []int) { func (*DecryptSecretData) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{42} return fileDescriptor_5c21d519a9be369a, []int{43}
} }
func (m *DecryptSecretData) XXX_Unmarshal(b []byte) error { func (m *DecryptSecretData) XXX_Unmarshal(b []byte) error {
...@@ -2487,7 +2678,7 @@ func (m *DepositInfo) Reset() { *m = DepositInfo{} } ...@@ -2487,7 +2678,7 @@ func (m *DepositInfo) Reset() { *m = DepositInfo{} }
func (m *DepositInfo) String() string { return proto.CompactTextString(m) } func (m *DepositInfo) String() string { return proto.CompactTextString(m) }
func (*DepositInfo) ProtoMessage() {} func (*DepositInfo) ProtoMessage() {}
func (*DepositInfo) Descriptor() ([]byte, []int) { func (*DepositInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{43} return fileDescriptor_5c21d519a9be369a, []int{44}
} }
func (m *DepositInfo) XXX_Unmarshal(b []byte) error { func (m *DepositInfo) XXX_Unmarshal(b []byte) error {
...@@ -2549,7 +2740,7 @@ func (m *DepositTxReq) Reset() { *m = DepositTxReq{} } ...@@ -2549,7 +2740,7 @@ func (m *DepositTxReq) Reset() { *m = DepositTxReq{} }
func (m *DepositTxReq) String() string { return proto.CompactTextString(m) } func (m *DepositTxReq) String() string { return proto.CompactTextString(m) }
func (*DepositTxReq) ProtoMessage() {} func (*DepositTxReq) ProtoMessage() {}
func (*DepositTxReq) Descriptor() ([]byte, []int) { func (*DepositTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{44} return fileDescriptor_5c21d519a9be369a, []int{45}
} }
func (m *DepositTxReq) XXX_Unmarshal(b []byte) error { func (m *DepositTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2597,7 +2788,7 @@ func (m *DepositProofResp) Reset() { *m = DepositProofResp{} } ...@@ -2597,7 +2788,7 @@ func (m *DepositProofResp) Reset() { *m = DepositProofResp{} }
func (m *DepositProofResp) String() string { return proto.CompactTextString(m) } func (m *DepositProofResp) String() string { return proto.CompactTextString(m) }
func (*DepositProofResp) ProtoMessage() {} func (*DepositProofResp) ProtoMessage() {}
func (*DepositProofResp) Descriptor() ([]byte, []int) { func (*DepositProofResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{45} return fileDescriptor_5c21d519a9be369a, []int{46}
} }
func (m *DepositProofResp) XXX_Unmarshal(b []byte) error { func (m *DepositProofResp) XXX_Unmarshal(b []byte) error {
...@@ -2652,7 +2843,7 @@ func (m *TreePathProof) Reset() { *m = TreePathProof{} } ...@@ -2652,7 +2843,7 @@ func (m *TreePathProof) Reset() { *m = TreePathProof{} }
func (m *TreePathProof) String() string { return proto.CompactTextString(m) } func (m *TreePathProof) String() string { return proto.CompactTextString(m) }
func (*TreePathProof) ProtoMessage() {} func (*TreePathProof) ProtoMessage() {}
func (*TreePathProof) Descriptor() ([]byte, []int) { func (*TreePathProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{46} return fileDescriptor_5c21d519a9be369a, []int{47}
} }
func (m *TreePathProof) XXX_Unmarshal(b []byte) error { func (m *TreePathProof) XXX_Unmarshal(b []byte) error {
...@@ -2708,7 +2899,7 @@ func (m *WithdrawTxReq) Reset() { *m = WithdrawTxReq{} } ...@@ -2708,7 +2899,7 @@ func (m *WithdrawTxReq) Reset() { *m = WithdrawTxReq{} }
func (m *WithdrawTxReq) String() string { return proto.CompactTextString(m) } func (m *WithdrawTxReq) String() string { return proto.CompactTextString(m) }
func (*WithdrawTxReq) ProtoMessage() {} func (*WithdrawTxReq) ProtoMessage() {}
func (*WithdrawTxReq) Descriptor() ([]byte, []int) { func (*WithdrawTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{47} return fileDescriptor_5c21d519a9be369a, []int{48}
} }
func (m *WithdrawTxReq) XXX_Unmarshal(b []byte) error { func (m *WithdrawTxReq) XXX_Unmarshal(b []byte) error {
...@@ -2750,101 +2941,6 @@ func (m *WithdrawTxReq) GetZkPath() string { ...@@ -2750,101 +2941,6 @@ func (m *WithdrawTxReq) GetZkPath() string {
return "" return ""
} }
type WithdrawProofRe struct {
Secret *SecretData `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
NullifierHash string `protobuf:"bytes,2,opt,name=nullifierHash,proto3" json:"nullifierHash,omitempty"`
AuthorizeSpendHash string `protobuf:"bytes,3,opt,name=authorizeSpendHash,proto3" json:"authorizeSpendHash,omitempty"`
NoteHash string `protobuf:"bytes,4,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
SpendPrivKey string `protobuf:"bytes,5,opt,name=spendPrivKey,proto3" json:"spendPrivKey,omitempty"`
SpendFlag string `protobuf:"bytes,6,opt,name=spendFlag,proto3" json:"spendFlag,omitempty"`
AuthorizeFlag string `protobuf:"bytes,7,opt,name=authorizeFlag,proto3" json:"authorizeFlag,omitempty"`
TreeProof *TreePathProof `protobuf:"bytes,8,opt,name=treeProof,proto3" json:"treeProof,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WithdrawProofRe) Reset() { *m = WithdrawProofRe{} }
func (m *WithdrawProofRe) String() string { return proto.CompactTextString(m) }
func (*WithdrawProofRe) ProtoMessage() {}
func (*WithdrawProofRe) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{48}
}
func (m *WithdrawProofRe) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WithdrawProofRe.Unmarshal(m, b)
}
func (m *WithdrawProofRe) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WithdrawProofRe.Marshal(b, m, deterministic)
}
func (m *WithdrawProofRe) XXX_Merge(src proto.Message) {
xxx_messageInfo_WithdrawProofRe.Merge(m, src)
}
func (m *WithdrawProofRe) XXX_Size() int {
return xxx_messageInfo_WithdrawProofRe.Size(m)
}
func (m *WithdrawProofRe) XXX_DiscardUnknown() {
xxx_messageInfo_WithdrawProofRe.DiscardUnknown(m)
}
var xxx_messageInfo_WithdrawProofRe proto.InternalMessageInfo
func (m *WithdrawProofRe) GetSecret() *SecretData {
if m != nil {
return m.Secret
}
return nil
}
func (m *WithdrawProofRe) GetNullifierHash() string {
if m != nil {
return m.NullifierHash
}
return ""
}
func (m *WithdrawProofRe) GetAuthorizeSpendHash() string {
if m != nil {
return m.AuthorizeSpendHash
}
return ""
}
func (m *WithdrawProofRe) GetNoteHash() string {
if m != nil {
return m.NoteHash
}
return ""
}
func (m *WithdrawProofRe) GetSpendPrivKey() string {
if m != nil {
return m.SpendPrivKey
}
return ""
}
func (m *WithdrawProofRe) GetSpendFlag() string {
if m != nil {
return m.SpendFlag
}
return ""
}
func (m *WithdrawProofRe) GetAuthorizeFlag() string {
if m != nil {
return m.AuthorizeFlag
}
return ""
}
func (m *WithdrawProofRe) GetTreeProof() *TreePathProof {
if m != nil {
return m.TreeProof
}
return nil
}
//只授权一个note,超过一个,toAddr不好设置 //只授权一个note,超过一个,toAddr不好设置
type AuthTxReq struct { type AuthTxReq struct {
NoteHash string `protobuf:"bytes,1,opt,name=noteHash,proto3" json:"noteHash,omitempty"` NoteHash string `protobuf:"bytes,1,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
...@@ -2901,101 +2997,6 @@ func (m *AuthTxReq) GetZkPath() string { ...@@ -2901,101 +2997,6 @@ func (m *AuthTxReq) GetZkPath() string {
return "" return ""
} }
type AuthProofRe struct {
Proof *SecretData `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"`
AuthPubKey string `protobuf:"bytes,2,opt,name=authPubKey,proto3" json:"authPubKey,omitempty"`
AuthPrivKey string `protobuf:"bytes,3,opt,name=authPrivKey,proto3" json:"authPrivKey,omitempty"`
AuthHash string `protobuf:"bytes,4,opt,name=authHash,proto3" json:"authHash,omitempty"`
AuthorizeSpendHash string `protobuf:"bytes,5,opt,name=authorizeSpendHash,proto3" json:"authorizeSpendHash,omitempty"`
NoteHash string `protobuf:"bytes,6,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
SpendFlag string `protobuf:"bytes,7,opt,name=spendFlag,proto3" json:"spendFlag,omitempty"`
TreeProof *TreePathProof `protobuf:"bytes,8,opt,name=treeProof,proto3" json:"treeProof,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AuthProofRe) Reset() { *m = AuthProofRe{} }
func (m *AuthProofRe) String() string { return proto.CompactTextString(m) }
func (*AuthProofRe) ProtoMessage() {}
func (*AuthProofRe) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{50}
}
func (m *AuthProofRe) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AuthProofRe.Unmarshal(m, b)
}
func (m *AuthProofRe) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AuthProofRe.Marshal(b, m, deterministic)
}
func (m *AuthProofRe) XXX_Merge(src proto.Message) {
xxx_messageInfo_AuthProofRe.Merge(m, src)
}
func (m *AuthProofRe) XXX_Size() int {
return xxx_messageInfo_AuthProofRe.Size(m)
}
func (m *AuthProofRe) XXX_DiscardUnknown() {
xxx_messageInfo_AuthProofRe.DiscardUnknown(m)
}
var xxx_messageInfo_AuthProofRe proto.InternalMessageInfo
func (m *AuthProofRe) GetProof() *SecretData {
if m != nil {
return m.Proof
}
return nil
}
func (m *AuthProofRe) GetAuthPubKey() string {
if m != nil {
return m.AuthPubKey
}
return ""
}
func (m *AuthProofRe) GetAuthPrivKey() string {
if m != nil {
return m.AuthPrivKey
}
return ""
}
func (m *AuthProofRe) GetAuthHash() string {
if m != nil {
return m.AuthHash
}
return ""
}
func (m *AuthProofRe) GetAuthorizeSpendHash() string {
if m != nil {
return m.AuthorizeSpendHash
}
return ""
}
func (m *AuthProofRe) GetNoteHash() string {
if m != nil {
return m.NoteHash
}
return ""
}
func (m *AuthProofRe) GetSpendFlag() string {
if m != nil {
return m.SpendFlag
}
return ""
}
func (m *AuthProofRe) GetTreeProof() *TreePathProof {
if m != nil {
return m.TreeProof
}
return nil
}
type TransferInputTxReq struct { type TransferInputTxReq struct {
NoteHashs string `protobuf:"bytes,1,opt,name=noteHashs,proto3" json:"noteHashs,omitempty"` NoteHashs string `protobuf:"bytes,1,opt,name=noteHashs,proto3" json:"noteHashs,omitempty"`
ZkPath string `protobuf:"bytes,2,opt,name=zkPath,proto3" json:"zkPath,omitempty"` ZkPath string `protobuf:"bytes,2,opt,name=zkPath,proto3" json:"zkPath,omitempty"`
...@@ -3008,7 +3009,7 @@ func (m *TransferInputTxReq) Reset() { *m = TransferInputTxReq{} } ...@@ -3008,7 +3009,7 @@ func (m *TransferInputTxReq) Reset() { *m = TransferInputTxReq{} }
func (m *TransferInputTxReq) String() string { return proto.CompactTextString(m) } func (m *TransferInputTxReq) String() string { return proto.CompactTextString(m) }
func (*TransferInputTxReq) ProtoMessage() {} func (*TransferInputTxReq) ProtoMessage() {}
func (*TransferInputTxReq) Descriptor() ([]byte, []int) { func (*TransferInputTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{51} return fileDescriptor_5c21d519a9be369a, []int{50}
} }
func (m *TransferInputTxReq) XXX_Unmarshal(b []byte) error { func (m *TransferInputTxReq) XXX_Unmarshal(b []byte) error {
...@@ -3055,7 +3056,7 @@ func (m *TransferOutputTxReq) Reset() { *m = TransferOutputTxReq{} } ...@@ -3055,7 +3056,7 @@ func (m *TransferOutputTxReq) Reset() { *m = TransferOutputTxReq{} }
func (m *TransferOutputTxReq) String() string { return proto.CompactTextString(m) } func (m *TransferOutputTxReq) String() string { return proto.CompactTextString(m) }
func (*TransferOutputTxReq) ProtoMessage() {} func (*TransferOutputTxReq) ProtoMessage() {}
func (*TransferOutputTxReq) Descriptor() ([]byte, []int) { func (*TransferOutputTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{52} return fileDescriptor_5c21d519a9be369a, []int{51}
} }
func (m *TransferOutputTxReq) XXX_Unmarshal(b []byte) error { func (m *TransferOutputTxReq) XXX_Unmarshal(b []byte) error {
...@@ -3102,7 +3103,7 @@ func (m *TransferTxReq) Reset() { *m = TransferTxReq{} } ...@@ -3102,7 +3103,7 @@ func (m *TransferTxReq) Reset() { *m = TransferTxReq{} }
func (m *TransferTxReq) String() string { return proto.CompactTextString(m) } func (m *TransferTxReq) String() string { return proto.CompactTextString(m) }
func (*TransferTxReq) ProtoMessage() {} func (*TransferTxReq) ProtoMessage() {}
func (*TransferTxReq) Descriptor() ([]byte, []int) { func (*TransferTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{53} return fileDescriptor_5c21d519a9be369a, []int{52}
} }
func (m *TransferTxReq) XXX_Unmarshal(b []byte) error { func (m *TransferTxReq) XXX_Unmarshal(b []byte) error {
...@@ -3150,7 +3151,7 @@ func (m *ShieldAmount) Reset() { *m = ShieldAmount{} } ...@@ -3150,7 +3151,7 @@ func (m *ShieldAmount) Reset() { *m = ShieldAmount{} }
func (m *ShieldAmount) String() string { return proto.CompactTextString(m) } func (m *ShieldAmount) String() string { return proto.CompactTextString(m) }
func (*ShieldAmount) ProtoMessage() {} func (*ShieldAmount) ProtoMessage() {}
func (*ShieldAmount) Descriptor() ([]byte, []int) { func (*ShieldAmount) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{54} return fileDescriptor_5c21d519a9be369a, []int{53}
} }
func (m *ShieldAmount) XXX_Unmarshal(b []byte) error { func (m *ShieldAmount) XXX_Unmarshal(b []byte) error {
...@@ -3185,243 +3186,6 @@ func (m *ShieldAmount) GetY() string { ...@@ -3185,243 +3186,6 @@ func (m *ShieldAmount) GetY() string {
return "" return ""
} }
type TransferInputProof struct {
Proof *SecretData `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"`
NullifierHash string `protobuf:"bytes,2,opt,name=nullifierHash,proto3" json:"nullifierHash,omitempty"`
AuthorizeSpendHash string `protobuf:"bytes,3,opt,name=authorizeSpendHash,proto3" json:"authorizeSpendHash,omitempty"`
NoteHash string `protobuf:"bytes,4,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
SpendPrivKey string `protobuf:"bytes,5,opt,name=spendPrivKey,proto3" json:"spendPrivKey,omitempty"`
SpendFlag string `protobuf:"bytes,6,opt,name=spendFlag,proto3" json:"spendFlag,omitempty"`
AuthorizeFlag string `protobuf:"bytes,7,opt,name=authorizeFlag,proto3" json:"authorizeFlag,omitempty"`
TreeProof *TreePathProof `protobuf:"bytes,8,opt,name=treeProof,proto3" json:"treeProof,omitempty"`
ShieldAmount *ShieldAmount `protobuf:"bytes,9,opt,name=shieldAmount,proto3" json:"shieldAmount,omitempty"`
AmountRandom string `protobuf:"bytes,10,opt,name=amountRandom,proto3" json:"amountRandom,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TransferInputProof) Reset() { *m = TransferInputProof{} }
func (m *TransferInputProof) String() string { return proto.CompactTextString(m) }
func (*TransferInputProof) ProtoMessage() {}
func (*TransferInputProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{55}
}
func (m *TransferInputProof) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferInputProof.Unmarshal(m, b)
}
func (m *TransferInputProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransferInputProof.Marshal(b, m, deterministic)
}
func (m *TransferInputProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransferInputProof.Merge(m, src)
}
func (m *TransferInputProof) XXX_Size() int {
return xxx_messageInfo_TransferInputProof.Size(m)
}
func (m *TransferInputProof) XXX_DiscardUnknown() {
xxx_messageInfo_TransferInputProof.DiscardUnknown(m)
}
var xxx_messageInfo_TransferInputProof proto.InternalMessageInfo
func (m *TransferInputProof) GetProof() *SecretData {
if m != nil {
return m.Proof
}
return nil
}
func (m *TransferInputProof) GetNullifierHash() string {
if m != nil {
return m.NullifierHash
}
return ""
}
func (m *TransferInputProof) GetAuthorizeSpendHash() string {
if m != nil {
return m.AuthorizeSpendHash
}
return ""
}
func (m *TransferInputProof) GetNoteHash() string {
if m != nil {
return m.NoteHash
}
return ""
}
func (m *TransferInputProof) GetSpendPrivKey() string {
if m != nil {
return m.SpendPrivKey
}
return ""
}
func (m *TransferInputProof) GetSpendFlag() string {
if m != nil {
return m.SpendFlag
}
return ""
}
func (m *TransferInputProof) GetAuthorizeFlag() string {
if m != nil {
return m.AuthorizeFlag
}
return ""
}
func (m *TransferInputProof) GetTreeProof() *TreePathProof {
if m != nil {
return m.TreeProof
}
return nil
}
func (m *TransferInputProof) GetShieldAmount() *ShieldAmount {
if m != nil {
return m.ShieldAmount
}
return nil
}
func (m *TransferInputProof) GetAmountRandom() string {
if m != nil {
return m.AmountRandom
}
return ""
}
type TransferOutputProof struct {
Proof *SecretData `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"`
NoteHash string `protobuf:"bytes,2,opt,name=noteHash,proto3" json:"noteHash,omitempty"`
Secrets *DHSecretGroup `protobuf:"bytes,3,opt,name=secrets,proto3" json:"secrets,omitempty"`
ShieldAmount *ShieldAmount `protobuf:"bytes,4,opt,name=shieldAmount,proto3" json:"shieldAmount,omitempty"`
AmountRandom string `protobuf:"bytes,5,opt,name=amountRandom,proto3" json:"amountRandom,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TransferOutputProof) Reset() { *m = TransferOutputProof{} }
func (m *TransferOutputProof) String() string { return proto.CompactTextString(m) }
func (*TransferOutputProof) ProtoMessage() {}
func (*TransferOutputProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{56}
}
func (m *TransferOutputProof) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferOutputProof.Unmarshal(m, b)
}
func (m *TransferOutputProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransferOutputProof.Marshal(b, m, deterministic)
}
func (m *TransferOutputProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransferOutputProof.Merge(m, src)
}
func (m *TransferOutputProof) XXX_Size() int {
return xxx_messageInfo_TransferOutputProof.Size(m)
}
func (m *TransferOutputProof) XXX_DiscardUnknown() {
xxx_messageInfo_TransferOutputProof.DiscardUnknown(m)
}
var xxx_messageInfo_TransferOutputProof proto.InternalMessageInfo
func (m *TransferOutputProof) GetProof() *SecretData {
if m != nil {
return m.Proof
}
return nil
}
func (m *TransferOutputProof) GetNoteHash() string {
if m != nil {
return m.NoteHash
}
return ""
}
func (m *TransferOutputProof) GetSecrets() *DHSecretGroup {
if m != nil {
return m.Secrets
}
return nil
}
func (m *TransferOutputProof) GetShieldAmount() *ShieldAmount {
if m != nil {
return m.ShieldAmount
}
return nil
}
func (m *TransferOutputProof) GetAmountRandom() string {
if m != nil {
return m.AmountRandom
}
return ""
}
type TransferProofResp struct {
TransferInput *TransferInputProof `protobuf:"bytes,1,opt,name=transferInput,proto3" json:"transferInput,omitempty"`
TargetOutput *TransferOutputProof `protobuf:"bytes,2,opt,name=targetOutput,proto3" json:"targetOutput,omitempty"`
ChangeOutput *TransferOutputProof `protobuf:"bytes,3,opt,name=changeOutput,proto3" json:"changeOutput,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TransferProofResp) Reset() { *m = TransferProofResp{} }
func (m *TransferProofResp) String() string { return proto.CompactTextString(m) }
func (*TransferProofResp) ProtoMessage() {}
func (*TransferProofResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{57}
}
func (m *TransferProofResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferProofResp.Unmarshal(m, b)
}
func (m *TransferProofResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TransferProofResp.Marshal(b, m, deterministic)
}
func (m *TransferProofResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_TransferProofResp.Merge(m, src)
}
func (m *TransferProofResp) XXX_Size() int {
return xxx_messageInfo_TransferProofResp.Size(m)
}
func (m *TransferProofResp) XXX_DiscardUnknown() {
xxx_messageInfo_TransferProofResp.DiscardUnknown(m)
}
var xxx_messageInfo_TransferProofResp proto.InternalMessageInfo
func (m *TransferProofResp) GetTransferInput() *TransferInputProof {
if m != nil {
return m.TransferInput
}
return nil
}
func (m *TransferProofResp) GetTargetOutput() *TransferOutputProof {
if m != nil {
return m.TargetOutput
}
return nil
}
func (m *TransferProofResp) GetChangeOutput() *TransferOutputProof {
if m != nil {
return m.ChangeOutput
}
return nil
}
type ShieldAmountRst struct { type ShieldAmountRst struct {
InputRandoms []string `protobuf:"bytes,1,rep,name=inputRandoms,proto3" json:"inputRandoms,omitempty"` InputRandoms []string `protobuf:"bytes,1,rep,name=inputRandoms,proto3" json:"inputRandoms,omitempty"`
OutputRandom string `protobuf:"bytes,2,opt,name=outputRandom,proto3" json:"outputRandom,omitempty"` OutputRandom string `protobuf:"bytes,2,opt,name=outputRandom,proto3" json:"outputRandom,omitempty"`
...@@ -3438,7 +3202,7 @@ func (m *ShieldAmountRst) Reset() { *m = ShieldAmountRst{} } ...@@ -3438,7 +3202,7 @@ func (m *ShieldAmountRst) Reset() { *m = ShieldAmountRst{} }
func (m *ShieldAmountRst) String() string { return proto.CompactTextString(m) } func (m *ShieldAmountRst) String() string { return proto.CompactTextString(m) }
func (*ShieldAmountRst) ProtoMessage() {} func (*ShieldAmountRst) ProtoMessage() {}
func (*ShieldAmountRst) Descriptor() ([]byte, []int) { func (*ShieldAmountRst) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{58} return fileDescriptor_5c21d519a9be369a, []int{54}
} }
func (m *ShieldAmountRst) XXX_Unmarshal(b []byte) error { func (m *ShieldAmountRst) XXX_Unmarshal(b []byte) error {
...@@ -3505,7 +3269,7 @@ type CreateRawTxReq struct { ...@@ -3505,7 +3269,7 @@ type CreateRawTxReq struct {
ActionTy int32 `protobuf:"varint,1,opt,name=actionTy,proto3" json:"actionTy,omitempty"` ActionTy int32 `protobuf:"varint,1,opt,name=actionTy,proto3" json:"actionTy,omitempty"`
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
AssetExec string `protobuf:"bytes,2,opt,name=assetExec,proto3" json:"assetExec,omitempty"` AssetExec string `protobuf:"bytes,2,opt,name=assetExec,proto3" json:"assetExec,omitempty"`
AssetToken string `protobuf:"bytes,3,opt,name=assetToken,proto3" json:"assetToken,omitempty"` AssetSymbol string `protobuf:"bytes,3,opt,name=assetSymbol,proto3" json:"assetSymbol,omitempty"`
Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"`
Privacy int32 `protobuf:"varint,7,opt,name=privacy,proto3" json:"privacy,omitempty"` Privacy int32 `protobuf:"varint,7,opt,name=privacy,proto3" json:"privacy,omitempty"`
Verify int32 `protobuf:"varint,8,opt,name=verify,proto3" json:"verify,omitempty"` Verify int32 `protobuf:"varint,8,opt,name=verify,proto3" json:"verify,omitempty"`
...@@ -3518,7 +3282,7 @@ func (m *CreateRawTxReq) Reset() { *m = CreateRawTxReq{} } ...@@ -3518,7 +3282,7 @@ func (m *CreateRawTxReq) Reset() { *m = CreateRawTxReq{} }
func (m *CreateRawTxReq) String() string { return proto.CompactTextString(m) } func (m *CreateRawTxReq) String() string { return proto.CompactTextString(m) }
func (*CreateRawTxReq) ProtoMessage() {} func (*CreateRawTxReq) ProtoMessage() {}
func (*CreateRawTxReq) Descriptor() ([]byte, []int) { func (*CreateRawTxReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{59} return fileDescriptor_5c21d519a9be369a, []int{55}
} }
func (m *CreateRawTxReq) XXX_Unmarshal(b []byte) error { func (m *CreateRawTxReq) XXX_Unmarshal(b []byte) error {
...@@ -3560,9 +3324,9 @@ func (m *CreateRawTxReq) GetAssetExec() string { ...@@ -3560,9 +3324,9 @@ func (m *CreateRawTxReq) GetAssetExec() string {
return "" return ""
} }
func (m *CreateRawTxReq) GetAssetToken() string { func (m *CreateRawTxReq) GetAssetSymbol() string {
if m != nil { if m != nil {
return m.AssetToken return m.AssetSymbol
} }
return "" return ""
} }
...@@ -3601,7 +3365,7 @@ func (m *PaymentKeysReq) Reset() { *m = PaymentKeysReq{} } ...@@ -3601,7 +3365,7 @@ func (m *PaymentKeysReq) Reset() { *m = PaymentKeysReq{} }
func (m *PaymentKeysReq) String() string { return proto.CompactTextString(m) } func (m *PaymentKeysReq) String() string { return proto.CompactTextString(m) }
func (*PaymentKeysReq) ProtoMessage() {} func (*PaymentKeysReq) ProtoMessage() {}
func (*PaymentKeysReq) Descriptor() ([]byte, []int) { func (*PaymentKeysReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{60} return fileDescriptor_5c21d519a9be369a, []int{56}
} }
func (m *PaymentKeysReq) XXX_Unmarshal(b []byte) error { func (m *PaymentKeysReq) XXX_Unmarshal(b []byte) error {
...@@ -3660,7 +3424,7 @@ func (m *WalletNoteInfo) Reset() { *m = WalletNoteInfo{} } ...@@ -3660,7 +3424,7 @@ func (m *WalletNoteInfo) Reset() { *m = WalletNoteInfo{} }
func (m *WalletNoteInfo) String() string { return proto.CompactTextString(m) } func (m *WalletNoteInfo) String() string { return proto.CompactTextString(m) }
func (*WalletNoteInfo) ProtoMessage() {} func (*WalletNoteInfo) ProtoMessage() {}
func (*WalletNoteInfo) Descriptor() ([]byte, []int) { func (*WalletNoteInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{61} return fileDescriptor_5c21d519a9be369a, []int{57}
} }
func (m *WalletNoteInfo) XXX_Unmarshal(b []byte) error { func (m *WalletNoteInfo) XXX_Unmarshal(b []byte) error {
...@@ -3742,7 +3506,7 @@ func (m *WalletDbMixInfo) Reset() { *m = WalletDbMixInfo{} } ...@@ -3742,7 +3506,7 @@ func (m *WalletDbMixInfo) Reset() { *m = WalletDbMixInfo{} }
func (m *WalletDbMixInfo) String() string { return proto.CompactTextString(m) } func (m *WalletDbMixInfo) String() string { return proto.CompactTextString(m) }
func (*WalletDbMixInfo) ProtoMessage() {} func (*WalletDbMixInfo) ProtoMessage() {}
func (*WalletDbMixInfo) Descriptor() ([]byte, []int) { func (*WalletDbMixInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{62} return fileDescriptor_5c21d519a9be369a, []int{58}
} }
func (m *WalletDbMixInfo) XXX_Unmarshal(b []byte) error { func (m *WalletDbMixInfo) XXX_Unmarshal(b []byte) error {
...@@ -3795,7 +3559,7 @@ func (m *WalletMixIndexReq) Reset() { *m = WalletMixIndexReq{} } ...@@ -3795,7 +3559,7 @@ func (m *WalletMixIndexReq) Reset() { *m = WalletMixIndexReq{} }
func (m *WalletMixIndexReq) String() string { return proto.CompactTextString(m) } func (m *WalletMixIndexReq) String() string { return proto.CompactTextString(m) }
func (*WalletMixIndexReq) ProtoMessage() {} func (*WalletMixIndexReq) ProtoMessage() {}
func (*WalletMixIndexReq) Descriptor() ([]byte, []int) { func (*WalletMixIndexReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{63} return fileDescriptor_5c21d519a9be369a, []int{59}
} }
func (m *WalletMixIndexReq) XXX_Unmarshal(b []byte) error { func (m *WalletMixIndexReq) XXX_Unmarshal(b []byte) error {
...@@ -3883,7 +3647,7 @@ func (m *WalletNoteResp) Reset() { *m = WalletNoteResp{} } ...@@ -3883,7 +3647,7 @@ func (m *WalletNoteResp) Reset() { *m = WalletNoteResp{} }
func (m *WalletNoteResp) String() string { return proto.CompactTextString(m) } func (m *WalletNoteResp) String() string { return proto.CompactTextString(m) }
func (*WalletNoteResp) ProtoMessage() {} func (*WalletNoteResp) ProtoMessage() {}
func (*WalletNoteResp) Descriptor() ([]byte, []int) { func (*WalletNoteResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{64} return fileDescriptor_5c21d519a9be369a, []int{60}
} }
func (m *WalletNoteResp) XXX_Unmarshal(b []byte) error { func (m *WalletNoteResp) XXX_Unmarshal(b []byte) error {
...@@ -3924,7 +3688,7 @@ func (m *WalletEnablePrivacyRst) Reset() { *m = WalletEnablePrivacyRst{} ...@@ -3924,7 +3688,7 @@ func (m *WalletEnablePrivacyRst) Reset() { *m = WalletEnablePrivacyRst{}
func (m *WalletEnablePrivacyRst) String() string { return proto.CompactTextString(m) } func (m *WalletEnablePrivacyRst) String() string { return proto.CompactTextString(m) }
func (*WalletEnablePrivacyRst) ProtoMessage() {} func (*WalletEnablePrivacyRst) ProtoMessage() {}
func (*WalletEnablePrivacyRst) Descriptor() ([]byte, []int) { func (*WalletEnablePrivacyRst) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{65} return fileDescriptor_5c21d519a9be369a, []int{61}
} }
func (m *WalletEnablePrivacyRst) XXX_Unmarshal(b []byte) error { func (m *WalletEnablePrivacyRst) XXX_Unmarshal(b []byte) error {
...@@ -3977,7 +3741,7 @@ func (m *WalletEnablePrivacyResp) Reset() { *m = WalletEnablePrivacyResp ...@@ -3977,7 +3741,7 @@ func (m *WalletEnablePrivacyResp) Reset() { *m = WalletEnablePrivacyResp
func (m *WalletEnablePrivacyResp) String() string { return proto.CompactTextString(m) } func (m *WalletEnablePrivacyResp) String() string { return proto.CompactTextString(m) }
func (*WalletEnablePrivacyResp) ProtoMessage() {} func (*WalletEnablePrivacyResp) ProtoMessage() {}
func (*WalletEnablePrivacyResp) Descriptor() ([]byte, []int) { func (*WalletEnablePrivacyResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{66} return fileDescriptor_5c21d519a9be369a, []int{62}
} }
func (m *WalletEnablePrivacyResp) XXX_Unmarshal(b []byte) error { func (m *WalletEnablePrivacyResp) XXX_Unmarshal(b []byte) error {
...@@ -4018,7 +3782,7 @@ func (m *LocalMixTx) Reset() { *m = LocalMixTx{} } ...@@ -4018,7 +3782,7 @@ func (m *LocalMixTx) Reset() { *m = LocalMixTx{} }
func (m *LocalMixTx) String() string { return proto.CompactTextString(m) } func (m *LocalMixTx) String() string { return proto.CompactTextString(m) }
func (*LocalMixTx) ProtoMessage() {} func (*LocalMixTx) ProtoMessage() {}
func (*LocalMixTx) Descriptor() ([]byte, []int) { func (*LocalMixTx) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{67} return fileDescriptor_5c21d519a9be369a, []int{63}
} }
func (m *LocalMixTx) XXX_Unmarshal(b []byte) error { func (m *LocalMixTx) XXX_Unmarshal(b []byte) error {
...@@ -4076,7 +3840,7 @@ func (m *MixTxListReq) Reset() { *m = MixTxListReq{} } ...@@ -4076,7 +3840,7 @@ func (m *MixTxListReq) Reset() { *m = MixTxListReq{} }
func (m *MixTxListReq) String() string { return proto.CompactTextString(m) } func (m *MixTxListReq) String() string { return proto.CompactTextString(m) }
func (*MixTxListReq) ProtoMessage() {} func (*MixTxListReq) ProtoMessage() {}
func (*MixTxListReq) Descriptor() ([]byte, []int) { func (*MixTxListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{68} return fileDescriptor_5c21d519a9be369a, []int{64}
} }
func (m *MixTxListReq) XXX_Unmarshal(b []byte) error { func (m *MixTxListReq) XXX_Unmarshal(b []byte) error {
...@@ -4150,7 +3914,7 @@ func (m *MixTxListResp) Reset() { *m = MixTxListResp{} } ...@@ -4150,7 +3914,7 @@ func (m *MixTxListResp) Reset() { *m = MixTxListResp{} }
func (m *MixTxListResp) String() string { return proto.CompactTextString(m) } func (m *MixTxListResp) String() string { return proto.CompactTextString(m) }
func (*MixTxListResp) ProtoMessage() {} func (*MixTxListResp) ProtoMessage() {}
func (*MixTxListResp) Descriptor() ([]byte, []int) { func (*MixTxListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{69} return fileDescriptor_5c21d519a9be369a, []int{65}
} }
func (m *MixTxListResp) XXX_Unmarshal(b []byte) error { func (m *MixTxListResp) XXX_Unmarshal(b []byte) error {
...@@ -4191,7 +3955,7 @@ func (m *PrivacyAddrResult) Reset() { *m = PrivacyAddrResult{} } ...@@ -4191,7 +3955,7 @@ func (m *PrivacyAddrResult) Reset() { *m = PrivacyAddrResult{} }
func (m *PrivacyAddrResult) String() string { return proto.CompactTextString(m) } func (m *PrivacyAddrResult) String() string { return proto.CompactTextString(m) }
func (*PrivacyAddrResult) ProtoMessage() {} func (*PrivacyAddrResult) ProtoMessage() {}
func (*PrivacyAddrResult) Descriptor() ([]byte, []int) { func (*PrivacyAddrResult) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{70} return fileDescriptor_5c21d519a9be369a, []int{66}
} }
func (m *PrivacyAddrResult) XXX_Unmarshal(b []byte) error { func (m *PrivacyAddrResult) XXX_Unmarshal(b []byte) error {
...@@ -4244,7 +4008,7 @@ func (m *ReqEnablePrivacyRst) Reset() { *m = ReqEnablePrivacyRst{} } ...@@ -4244,7 +4008,7 @@ func (m *ReqEnablePrivacyRst) Reset() { *m = ReqEnablePrivacyRst{} }
func (m *ReqEnablePrivacyRst) String() string { return proto.CompactTextString(m) } func (m *ReqEnablePrivacyRst) String() string { return proto.CompactTextString(m) }
func (*ReqEnablePrivacyRst) ProtoMessage() {} func (*ReqEnablePrivacyRst) ProtoMessage() {}
func (*ReqEnablePrivacyRst) Descriptor() ([]byte, []int) { func (*ReqEnablePrivacyRst) Descriptor() ([]byte, []int) {
return fileDescriptor_5c21d519a9be369a, []int{71} return fileDescriptor_5c21d519a9be369a, []int{67}
} }
func (m *ReqEnablePrivacyRst) XXX_Unmarshal(b []byte) error { func (m *ReqEnablePrivacyRst) XXX_Unmarshal(b []byte) error {
...@@ -4282,6 +4046,7 @@ func init() { ...@@ -4282,6 +4046,7 @@ func init() {
proto.RegisterType((*ZkVerifyKeys)(nil), "types.ZkVerifyKeys") proto.RegisterType((*ZkVerifyKeys)(nil), "types.ZkVerifyKeys")
proto.RegisterType((*AuthKeys)(nil), "types.AuthKeys") proto.RegisterType((*AuthKeys)(nil), "types.AuthKeys")
proto.RegisterType((*PaymentKey)(nil), "types.PaymentKey") proto.RegisterType((*PaymentKey)(nil), "types.PaymentKey")
proto.RegisterType((*TokenTxFee)(nil), "types.TokenTxFee")
proto.RegisterType((*MixConfigAction)(nil), "types.MixConfigAction") proto.RegisterType((*MixConfigAction)(nil), "types.MixConfigAction")
proto.RegisterType((*DHSecret)(nil), "types.DHSecret") proto.RegisterType((*DHSecret)(nil), "types.DHSecret")
proto.RegisterType((*DHSecretGroup)(nil), "types.DHSecretGroup") proto.RegisterType((*DHSecretGroup)(nil), "types.DHSecretGroup")
...@@ -4326,16 +4091,11 @@ func init() { ...@@ -4326,16 +4091,11 @@ func init() {
proto.RegisterType((*DepositProofResp)(nil), "types.DepositProofResp") proto.RegisterType((*DepositProofResp)(nil), "types.DepositProofResp")
proto.RegisterType((*TreePathProof)(nil), "types.TreePathProof") proto.RegisterType((*TreePathProof)(nil), "types.TreePathProof")
proto.RegisterType((*WithdrawTxReq)(nil), "types.WithdrawTxReq") proto.RegisterType((*WithdrawTxReq)(nil), "types.WithdrawTxReq")
proto.RegisterType((*WithdrawProofRe)(nil), "types.WithdrawProofRe")
proto.RegisterType((*AuthTxReq)(nil), "types.AuthTxReq") proto.RegisterType((*AuthTxReq)(nil), "types.AuthTxReq")
proto.RegisterType((*AuthProofRe)(nil), "types.AuthProofRe")
proto.RegisterType((*TransferInputTxReq)(nil), "types.TransferInputTxReq") proto.RegisterType((*TransferInputTxReq)(nil), "types.TransferInputTxReq")
proto.RegisterType((*TransferOutputTxReq)(nil), "types.TransferOutputTxReq") proto.RegisterType((*TransferOutputTxReq)(nil), "types.TransferOutputTxReq")
proto.RegisterType((*TransferTxReq)(nil), "types.TransferTxReq") proto.RegisterType((*TransferTxReq)(nil), "types.TransferTxReq")
proto.RegisterType((*ShieldAmount)(nil), "types.ShieldAmount") proto.RegisterType((*ShieldAmount)(nil), "types.ShieldAmount")
proto.RegisterType((*TransferInputProof)(nil), "types.TransferInputProof")
proto.RegisterType((*TransferOutputProof)(nil), "types.TransferOutputProof")
proto.RegisterType((*TransferProofResp)(nil), "types.TransferProofResp")
proto.RegisterType((*ShieldAmountRst)(nil), "types.ShieldAmountRst") proto.RegisterType((*ShieldAmountRst)(nil), "types.ShieldAmountRst")
proto.RegisterType((*CreateRawTxReq)(nil), "types.CreateRawTxReq") proto.RegisterType((*CreateRawTxReq)(nil), "types.CreateRawTxReq")
proto.RegisterType((*PaymentKeysReq)(nil), "types.PaymentKeysReq") proto.RegisterType((*PaymentKeysReq)(nil), "types.PaymentKeysReq")
...@@ -4357,187 +4117,178 @@ func init() { ...@@ -4357,187 +4117,178 @@ func init() {
} }
var fileDescriptor_5c21d519a9be369a = []byte{ var fileDescriptor_5c21d519a9be369a = []byte{
// 2867 bytes of a gzipped FileDescriptorProto // 2726 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4b, 0x6f, 0x23, 0xc7, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x1a, 0xcb, 0x6e, 0x23, 0xc7,
0x11, 0xd6, 0xf0, 0x29, 0x96, 0x48, 0x89, 0xea, 0x95, 0xb5, 0xb4, 0xe0, 0x18, 0x9b, 0xf6, 0xc6, 0x51, 0x43, 0x0e, 0x5f, 0x25, 0x52, 0xa2, 0x7a, 0x65, 0x2d, 0x2d, 0x38, 0x86, 0xd2, 0xde, 0xd8,
0x5e, 0x6b, 0x83, 0x8d, 0xad, 0x75, 0x1c, 0x18, 0x89, 0x37, 0xa1, 0x57, 0x94, 0x25, 0x7b, 0x45, 0xb2, 0x14, 0xc8, 0xb6, 0xd6, 0x36, 0x60, 0x24, 0x36, 0x4c, 0x2f, 0x29, 0x8b, 0xb6, 0x44, 0x09,
0x09, 0x4d, 0xee, 0xae, 0x1f, 0x70, 0x80, 0x11, 0xd9, 0x92, 0x06, 0x4b, 0x71, 0xb8, 0x33, 0x4d, 0x43, 0x6a, 0xd7, 0x0f, 0x38, 0xc0, 0x88, 0x6c, 0x89, 0x83, 0x25, 0x39, 0xdc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x98, 0x37, 0x90, 0x6b, 0x1d, 0x09, 0xad, 0x7e, 0x13, 0xe3, 0x68, 0xc8, 0x23, 0xad, 0x26, 0xa1, 0x34, 0x32, 0xf2, 0x16, 0xe4, 0x23, 0xb4, 0xe8, 0x01, 0x63, 0x95, 0xac, 0x71, 0x24, 0x31, 0xf4,
0xc9, 0x4b, 0x50, 0xc1, 0xfd, 0x84, 0x51, 0xf0, 0x05, 0xd7, 0xae, 0x49, 0x19, 0x74, 0x8c, 0x11, 0xe1, 0x92, 0x13, 0x13, 0x7d, 0x92, 0x93, 0x41, 0x45, 0x7f, 0x0a, 0xf9, 0xda, 0x61, 0x8b, 0x75,
0xba, 0x1f, 0x85, 0xe1, 0xe1, 0xce, 0xf0, 0x30, 0xc4, 0xd0, 0x1b, 0x21, 0xa1, 0xdf, 0xa0, 0x08, 0x02, 0x16, 0x91, 0x0a, 0xe4, 0x46, 0x4c, 0x78, 0x55, 0xf8, 0x41, 0x81, 0x68, 0xe3, 0x90, 0xd3,
0x0c, 0x80, 0xd1, 0xf8, 0x60, 0x10, 0xf4, 0x76, 0x86, 0xa3, 0xb1, 0x31, 0xd4, 0x66, 0x91, 0x7b, 0x48, 0x07, 0x48, 0x88, 0x32, 0x28, 0xa9, 0xd3, 0x9f, 0x06, 0xfe, 0x78, 0x44, 0x36, 0x21, 0xaf,
0x50, 0x56, 0x76, 0xc7, 0x1a, 0x77, 0xe3, 0x51, 0x67, 0x0f, 0xcc, 0x08, 0xd1, 0x07, 0x50, 0xdf, 0x22, 0x41, 0xf2, 0x88, 0x61, 0xf1, 0xb7, 0x68, 0x1c, 0x0c, 0x59, 0x20, 0xd9, 0xc4, 0x30, 0x0f,
0x0d, 0x26, 0x9b, 0x7c, 0x14, 0xc6, 0x81, 0xd0, 0xde, 0x5b, 0x87, 0x92, 0x7c, 0x5d, 0x7c, 0x2e, 0x82, 0x71, 0xd4, 0xf3, 0x03, 0xef, 0x5b, 0x26, 0x23, 0x26, 0x41, 0xd0, 0x31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0x21, 0x00, 0x00,
0xda, 0xf5, 0x3c, 0x6e, 0xeb, 0x71, 0x5b, 0x53, 0x85, 0xf5, 0x77, 0xe1, 0x85, 0xdd, 0x60, 0xa2,
0x82, 0x9c, 0xf1, 0xb8, 0xe7, 0x0f, 0xb5, 0xca, 0x79, 0x28, 0xec, 0x6c, 0x3e, 0x6a, 0x29, 0x1c,
0x3a, 0x0f, 0x9b, 0xed, 0xf6, 0x4e, 0xfb, 0xfd, 0xba, 0x87, 0xd4, 0xd6, 0x4e, 0x7b, 0xa7, 0xb3,
0x8d, 0x8a, 0x37, 0xfe, 0xe4, 0x01, 0x9c, 0x04, 0x13, 0x73, 0x2f, 0xf8, 0x16, 0x2c, 0xbd, 0x9f,
0xd1, 0x53, 0xd3, 0x3e, 0x60, 0xfc, 0x79, 0x3b, 0x18, 0xac, 0xd5, 0x53, 0xb2, 0x23, 0xa2, 0x60,
0x78, 0x44, 0xe7, 0xc8, 0x1b, 0xb0, 0xa0, 0x96, 0xe0, 0x8e, 0xae, 0xb4, 0xe2, 0x01, 0xd4, 0x1c,
0xef, 0x93, 0xa5, 0x54, 0x48, 0x5e, 0x69, 0xad, 0xad, 0xa5, 0x8c, 0x6c, 0x9c, 0xd0, 0xb9, 0x83,
0x92, 0xfc, 0x2f, 0xd2, 0xfd, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x9d, 0x05, 0x41, 0xc0,
0x24, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
......
...@@ -13,7 +13,9 @@ import ( ...@@ -13,7 +13,9 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/33cn/chain33/common/log/log15" log "github.com/33cn/chain33/common/log/log15"
coins "github.com/33cn/chain33/system/dapp/coins/types"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
token "github.com/33cn/plugin/plugin/dapp/token/types"
"github.com/consensys/gurvy/bn256/fr" "github.com/consensys/gurvy/bn256/fr"
"github.com/consensys/gurvy/bn256/twistededwards" "github.com/consensys/gurvy/bn256/twistededwards"
) )
...@@ -150,12 +152,12 @@ func MulCurvePointG(val interface{}) *twistededwards.Point { ...@@ -150,12 +152,12 @@ func MulCurvePointG(val interface{}) *twistededwards.Point {
return &point return &point
} }
func MulCurvePointH(val string) *twistededwards.Point { func MulCurvePointH(pointHX, pointHY, val string) *twistededwards.Point {
v := fr.FromInterface(val) v := fr.FromInterface(val)
var pointV, pointH twistededwards.Point var pointV, pointH twistededwards.Point
pointH.X.SetString(PointHX) pointH.X.SetString(pointHX)
pointH.Y.SetString(PointHY) pointH.Y.SetString(pointHY)
pointV.ScalarMul(&pointH, *v.FromMont()) pointV.ScalarMul(&pointH, *v.FromMont())
return &pointV return &pointV
...@@ -216,3 +218,25 @@ func GetFrRandom() string { ...@@ -216,3 +218,25 @@ func GetFrRandom() string {
var f fr.Element var f fr.Element
return f.SetRandom().String() return f.SetRandom().String()
} }
func GetAssetExecSymbol(cfg *types.Chain33Config, execer, symbol string) (string, string) {
if symbol == "" {
return coins.CoinsX, cfg.GetCoinSymbol()
}
if execer == "" {
return token.TokenX, symbol
}
return execer, symbol
}
func GetTransferTxFee(cfg *types.Chain33Config, assetExecer string) int64 {
conf := types.ConfSub(cfg, MixX)
txFee := conf.GInt("txFee")
tokenFee := conf.IsEnable("tokenFee")
//一切非coins的token资产 在tokenFee=false都不收txfee,特殊地址代扣
if assetExecer != coins.CoinsX && !tokenFee {
return 0
}
//tokenFee=true或者coins都按txfee数量收txFee
return txFee
}
...@@ -288,7 +288,7 @@ func (p *mixPolicy) rescanNotes() { ...@@ -288,7 +288,7 @@ func (p *mixPolicy) rescanNotes() {
// 1 先获取隐私合约地址相关交易 // 1 先获取隐私合约地址相关交易
var reqInfo mixTy.MixTxListReq var reqInfo mixTy.MixTxListReq
reqInfo.Direction = 0 reqInfo.Direction = 0
reqInfo.Count = int32(MaxTxHashsPerTime) reqInfo.Count = int32(maxTxHashsPerTime)
if i == 0 { if i == 0 {
reqInfo.Height = -1 reqInfo.Height = -1
...@@ -327,7 +327,7 @@ func (p *mixPolicy) rescanNotes() { ...@@ -327,7 +327,7 @@ func (p *mixPolicy) rescanNotes() {
} }
p.processPrivcyTxs(&ReqHashes) p.processPrivcyTxs(&ReqHashes)
if txcount < int(MaxTxHashsPerTime) { if txcount < int(maxTxHashsPerTime) {
break break
} }
} }
......
...@@ -15,17 +15,17 @@ import ( ...@@ -15,17 +15,17 @@ import (
"github.com/33cn/chain33/common/crypto" "github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/db" "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/log/log15" "github.com/33cn/chain33/common/log/log15"
coins "github.com/33cn/chain33/system/dapp/coins/types"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
wcom "github.com/33cn/chain33/wallet/common" wcom "github.com/33cn/chain33/wallet/common"
mixTy "github.com/33cn/plugin/plugin/dapp/mix/types" mixTy "github.com/33cn/plugin/plugin/dapp/mix/types"
"github.com/pkg/errors"
) )
var ( var (
bizlog = log15.New("module", "wallet.mix") bizlog = log15.New("module", "wallet.mix")
// MaxTxHashsPerTime 单词处理的最大哈希书 // MaxTxHashsPerTime 单词处理的最大哈希书
MaxTxHashsPerTime int64 = 100 maxTxHashsPerTime int64 = 100
// maxTxNumPerBlock 单个区块最大数
maxTxNumPerBlock int64 = types.MaxTxsPerBlock
) )
func init() { func init() {
...@@ -168,7 +168,10 @@ func (policy *mixPolicy) SignTransaction(key crypto.PrivKey, req *types.ReqSignR ...@@ -168,7 +168,10 @@ func (policy *mixPolicy) SignTransaction(key crypto.PrivKey, req *types.ReqSignR
} }
if action.Ty == mixTy.MixActionTransfer { if action.Ty == mixTy.MixActionTransfer {
// 隐私交易的私对私、私对公需要进行特殊签名 // 隐私交易的私对私、私对公需要进行特殊签名
policy.signatureTx(tx, action.GetTransfer()) err = policy.signatureTx(tx, action.GetTransfer())
if err != nil {
return
}
} else { } else {
tx.Sign(int32(policy.getWalletOperate().GetSignType()), key) tx.Sign(int32(policy.getWalletOperate().GetSignType()), key)
} }
...@@ -178,14 +181,30 @@ func (policy *mixPolicy) SignTransaction(key crypto.PrivKey, req *types.ReqSignR ...@@ -178,14 +181,30 @@ func (policy *mixPolicy) SignTransaction(key crypto.PrivKey, req *types.ReqSignR
} }
func (policy *mixPolicy) signatureTx(tx *types.Transaction, transfer *mixTy.MixTransferAction) error { func (policy *mixPolicy) signatureTx(tx *types.Transaction, transfer *mixTy.MixTransferAction) error {
if len(transfer.AssetSymbol) == 0 || len(transfer.AssetExec) == 0 {
return errors.Wrapf(types.ErrInvalidParam, "asset exec or symbol need be fill")
}
//1.如果是coins 执行器,默认符号是BTY,扣mix执行器地址的手续费
//2.如果token执行器, 如果tokenFee=false,则不扣token,且不以token做交易费,需要从另一个特殊地址mixtoken扣bty交易费,chain33发交易费给mixtoken地址
// 不然从mix执行器扣交易费会导致基于coins的隐私余额 入账和出账不平
//3.如果配置项tokenFee=true 则从以token扣手续费,地址是mix执行器的token资产
cfg := policy.getWalletOperate().GetAPI().GetConfig() cfg := policy.getWalletOperate().GetAPI().GetConfig()
conf := types.ConfSub(cfg, mixTy.MixX)
tokenFee := conf.IsEnable("tokenFee")
payFeeAddr := mixTy.MixX
if transfer.AssetExec != coins.CoinsX && !tokenFee {
payFeeAddr = mixTy.MixX + transfer.AssetExec + transfer.AssetSymbol
}
mixSignData := types.Encode(transfer) mixSignData := types.Encode(transfer)
tx.Fee = mixTy.Privacy2PrivacyTxFee tx.Fee = conf.GInt("txFee")
tx.Signature = &types.Signature{ tx.Signature = &types.Signature{
Ty: MixSignID, Ty: MixSignID,
Signature: common.BytesToHash(mixSignData).Bytes(), Signature: common.BytesToHash(mixSignData).Bytes(),
// 这里填的是mix合约的公钥,让框架保持一致 // 这里填的是mix合约的公钥,让框架保持一致
Pubkey: address.ExecPubKey(cfg.ExecName(mixTy.MixX)), Pubkey: address.ExecPubKey(payFeeAddr),
} }
return nil return nil
} }
...@@ -112,7 +112,7 @@ func (p *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, error) ...@@ -112,7 +112,7 @@ func (p *mixPolicy) getAuthParms(req *mixTy.AuthTxReq) (*AuthorizeInput, error)
} }
//get tree path //get tree path
treeProof, err := p.getTreeProof(note.NoteHash) treeProof, err := p.getTreeProof(note.Secret.AssetExec, note.Secret.AssetSymbol, note.NoteHash)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash) return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
} }
...@@ -134,6 +134,10 @@ func (p *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction, ...@@ -134,6 +134,10 @@ func (p *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction,
return nil, err return nil, err
} }
if len(req.AssetExec) == 0 || len(req.AssetSymbol) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "asset exec=%s or symbol=%s not filled", req.AssetExec, req.AssetSymbol)
}
proofInfo, err := getZkProofKeys(auth.ZkPath+mixTy.AuthCircuit, auth.ZkPath+mixTy.AuthPk, *input, req.Privacy) proofInfo, err := getZkProofKeys(auth.ZkPath+mixTy.AuthCircuit, auth.ZkPath+mixTy.AuthPk, *input, req.Privacy)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getZkProofKeys note=%s", auth.NoteHash) return nil, errors.Wrapf(err, "getZkProofKeys note=%s", auth.NoteHash)
...@@ -143,12 +147,14 @@ func (p *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction, ...@@ -143,12 +147,14 @@ func (p *mixPolicy) createAuthTx(req *mixTy.CreateRawTxReq) (*types.Transaction,
return nil, errors.Wrapf(err, "verifyProof fail for note=%s", auth.NoteHash) return nil, errors.Wrapf(err, "verifyProof fail for note=%s", auth.NoteHash)
} }
return p.getAuthTx(strings.TrimSpace(req.Title+mixTy.MixX), proofInfo) return p.getAuthTx(strings.TrimSpace(req.Title+mixTy.MixX), req.AssetExec, req.AssetSymbol, proofInfo)
} }
func (p *mixPolicy) getAuthTx(execName string, proof *mixTy.ZkProofInfo) (*types.Transaction, error) { func (p *mixPolicy) getAuthTx(execName string, exec, symbol string, proof *mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixAuthorizeAction{} payload := &mixTy.MixAuthorizeAction{}
payload.Proof = proof payload.Proof = proof
payload.AssetExec = exec
payload.AssetSymbol = symbol
cfg := p.getWalletOperate().GetAPI().GetConfig() cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{ action := &mixTy.MixAction{
......
...@@ -32,12 +32,17 @@ type DepositInput struct { ...@@ -32,12 +32,17 @@ type DepositInput struct {
NoteRandom string `tag:"secret"` NoteRandom string `tag:"secret"`
} }
func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mixTy.DepositProofResp, error) { func (p *mixPolicy) depositParams(exec, symbol, receiver, returner, auth, amount string) (*mixTy.DepositProofResp, error) {
if len(receiver) > 0 && len(returner) > 0 && (receiver == returner || receiver == auth || returner == auth) { if len(receiver) > 0 && len(returner) > 0 && (receiver == returner || receiver == auth || returner == auth) {
return nil, errors.Wrapf(types.ErrInvalidParam, "addrs should not be same to receiver=%s,return=%s,auth=%s", return nil, errors.Wrapf(types.ErrInvalidParam, "addrs should not be same to receiver=%s,return=%s,auth=%s",
receiver, returner, auth) receiver, returner, auth)
} }
//deposit 产生的secret需要确定的资产符号
if len(exec) == 0 || len(symbol) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "asset exec=%s or symbol=%s not filled", exec, symbol)
}
if len(receiver) <= 0 { if len(receiver) <= 0 {
return nil, errors.Wrap(types.ErrInvalidParam, "receiver is nil") return nil, errors.Wrap(types.ErrInvalidParam, "receiver is nil")
} }
...@@ -49,6 +54,8 @@ func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mix ...@@ -49,6 +54,8 @@ func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mix
var secret mixTy.SecretData var secret mixTy.SecretData
secret.Amount = amount secret.Amount = amount
secret.AssetExec = exec
secret.AssetSymbol = symbol
//1. nullifier 获取随机值 //1. nullifier 获取随机值
var fr fr_bn256.Element var fr fr_bn256.Element
...@@ -123,14 +130,15 @@ func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mix ...@@ -123,14 +130,15 @@ func (p *mixPolicy) depositParams(receiver, returner, auth, amount string) (*mix
secret.Amount, secret.Amount,
secret.NoteRandom, secret.NoteRandom,
} }
//exec,symbol没有计算进去,不然在电路中也要引入资产,noteRandom应该足够随机区分一个note了,不然Nullifier也要区分资产
resp.NoteHash = mixTy.Byte2Str(mimcHashString(keys)) resp.NoteHash = mixTy.Byte2Str(mimcHashString(keys))
return &resp, nil return &resp, nil
} }
func (p *mixPolicy) getDepositProof(receiver, returner, auth, amount, zkPath string, verifyOnChain, privacyPrint int32) (*mixTy.ZkProofInfo, error) { func (p *mixPolicy) getDepositProof(exec, symbol, receiver, returner, auth, amount, zkPath string, verifyOnChain, privacyPrint int32) (*mixTy.ZkProofInfo, error) {
resp, err := p.depositParams(receiver, returner, auth, amount) resp, err := p.depositParams(exec, symbol, receiver, returner, auth, amount)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -180,20 +188,22 @@ func (p *mixPolicy) createDepositTx(req *mixTy.CreateRawTxReq) (*types.Transacti ...@@ -180,20 +188,22 @@ func (p *mixPolicy) createDepositTx(req *mixTy.CreateRawTxReq) (*types.Transacti
var proofs []*mixTy.ZkProofInfo var proofs []*mixTy.ZkProofInfo
for i, rcv := range receivers { for i, rcv := range receivers {
p, err := p.getDepositProof(rcv, deposit.Deposit.ReturnAddr, deposit.Deposit.AuthorizeAddr, amounts[i], deposit.ZkPath, req.Verify, req.Privacy) p, err := p.getDepositProof(req.AssetExec, req.AssetSymbol, rcv, deposit.Deposit.ReturnAddr, deposit.Deposit.AuthorizeAddr, amounts[i], deposit.ZkPath, req.Verify, req.Privacy)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "get Deposit proof for=%s", rcv) return nil, errors.Wrapf(err, "get Deposit proof for=%s", rcv)
} }
proofs = append(proofs, p) proofs = append(proofs, p)
} }
return p.getDepositTx(strings.TrimSpace(req.Title+mixTy.MixX), proofs) return p.getDepositTx(strings.TrimSpace(req.Title+mixTy.MixX), req.AssetExec, req.AssetSymbol, proofs)
} }
func (p *mixPolicy) getDepositTx(execName string, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) { func (p *mixPolicy) getDepositTx(execName string, assetExec, assetSymbol string, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixDepositAction{} payload := &mixTy.MixDepositAction{}
payload.Proofs = proofs payload.Proofs = proofs
payload.AssetExec = assetExec
payload.AssetSymbol = assetSymbol
cfg := p.getWalletOperate().GetAPI().GetConfig() cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{ action := &mixTy.MixAction{
......
...@@ -132,7 +132,7 @@ func (p *mixPolicy) getTransferInputPart(note *mixTy.WalletNoteInfo) (*TransferI ...@@ -132,7 +132,7 @@ func (p *mixPolicy) getTransferInputPart(note *mixTy.WalletNoteInfo) (*TransferI
input.AuthorizeFlag = "1" input.AuthorizeFlag = "1"
} }
treeProof, err := p.getTreeProof(note.NoteHash) treeProof, err := p.getTreeProof(note.Secret.AssetExec, note.Secret.AssetSymbol, note.NoteHash)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash) return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
} }
...@@ -142,13 +142,13 @@ func (p *mixPolicy) getTransferInputPart(note *mixTy.WalletNoteInfo) (*TransferI ...@@ -142,13 +142,13 @@ func (p *mixPolicy) getTransferInputPart(note *mixTy.WalletNoteInfo) (*TransferI
return &input, nil return &input, nil
} }
func (p *mixPolicy) getTransferOutput(req *mixTy.DepositInfo) (*TransferOutput, *mixTy.DHSecretGroup, error) { func (p *mixPolicy) getTransferOutput(exec, symbol string, req *mixTy.DepositInfo) (*TransferOutput, *mixTy.DHSecretGroup, error) {
//目前只支持一个ReceiverAddr //目前只支持一个ReceiverAddr
if strings.Contains(req.ReceiverAddrs, ",") || strings.Contains(req.Amounts, ",") { if strings.Contains(req.ReceiverAddrs, ",") || strings.Contains(req.Amounts, ",") {
return nil, nil, errors.Wrapf(types.ErrInvalidParam, "only support one addr or amount,addrs=%s,amount=%s", return nil, nil, errors.Wrapf(types.ErrInvalidParam, "only support one addr or amount,addrs=%s,amount=%s",
req.ReceiverAddrs, req.Amounts) req.ReceiverAddrs, req.Amounts)
} }
resp, err := p.depositParams(req.ReceiverAddrs, req.ReturnAddr, req.AuthorizeAddr, req.Amounts) resp, err := p.depositParams(exec, symbol, req.ReceiverAddrs, req.ReturnAddr, req.AuthorizeAddr, req.Amounts)
if err != nil { if err != nil {
return nil, nil, errors.Wrapf(err, "deposit toAddr=%s", req.ReceiverAddrs) return nil, nil, errors.Wrapf(err, "deposit toAddr=%s", req.ReceiverAddrs)
} }
...@@ -166,7 +166,7 @@ func (p *mixPolicy) getTransferOutput(req *mixTy.DepositInfo) (*TransferOutput, ...@@ -166,7 +166,7 @@ func (p *mixPolicy) getTransferOutput(req *mixTy.DepositInfo) (*TransferOutput,
} }
//input = output+找零+交易费 //input = output+找零+交易费
func getShieldValue(inputAmounts []uint64, outAmount, change, minTxFee uint64) (*mixTy.ShieldAmountRst, error) { func getShieldValue(cfg *types.Chain33Config, inputAmounts []uint64, outAmount, change, minTxFee uint64) (*mixTy.ShieldAmountRst, error) {
var sum uint64 var sum uint64
for _, i := range inputAmounts { for _, i := range inputAmounts {
sum += i sum += i
...@@ -227,13 +227,17 @@ func getShieldValue(inputAmounts []uint64, outAmount, change, minTxFee uint64) ( ...@@ -227,13 +227,17 @@ func getShieldValue(inputAmounts []uint64, outAmount, change, minTxFee uint64) (
return nil, errors.Wrapf(types.ErrInvalidParam, "random sumIn=%s not equal sumOut=%s", rSumIn.String(), rSumOut.String()) return nil, errors.Wrapf(types.ErrInvalidParam, "random sumIn=%s not equal sumOut=%s", rSumIn.String(), rSumOut.String())
} }
conf := types.ConfSub(cfg, mixTy.MixX)
pointHX := conf.GStr("pointHX")
pointHY := conf.GStr("pointHY")
var inputHPoints []*twistededwards.Point var inputHPoints []*twistededwards.Point
for _, i := range rInputs { for _, i := range rInputs {
inputHPoints = append(inputHPoints, mixTy.MulCurvePointH(i.String())) inputHPoints = append(inputHPoints, mixTy.MulCurvePointH(pointHX, pointHY, i.String()))
} }
//noteH := mixTy.MulCurvePointH(rNote.String()) //noteH := mixTy.MulCurvePointH(rNote.String())
outH := mixTy.MulCurvePointH(rOut.String()) outH := mixTy.MulCurvePointH(pointHX, pointHY, rOut.String())
changeH := mixTy.MulCurvePointH(rChange.String()) changeH := mixTy.MulCurvePointH(pointHX, pointHY, rChange.String())
//fmt.Println("change",changeRandom.String()) //fmt.Println("change",changeRandom.String())
//fmt.Println("transfer",transRandom.String()) //fmt.Println("transfer",transRandom.String())
//fmt.Println("note",noteRandom.String()) //fmt.Println("note",noteRandom.String())
...@@ -275,6 +279,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -275,6 +279,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
return nil, errors.Wrap(err, "decode req fail") return nil, errors.Wrap(err, "decode req fail")
} }
if len(req.AssetExec) == 0 || len(req.AssetSymbol) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "asset exec=%s or symbol=%s not filled", req.AssetExec, req.AssetSymbol)
}
noteHashs := strings.Split(transfer.GetInput().NoteHashs, ",") noteHashs := strings.Split(transfer.GetInput().NoteHashs, ",")
var notes []*mixTy.WalletNoteInfo var notes []*mixTy.WalletNoteInfo
for _, h := range noteHashs { for _, h := range noteHashs {
...@@ -285,6 +293,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -285,6 +293,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
if note.Status != mixTy.NoteStatus_VALID && note.Status != mixTy.NoteStatus_UNFROZEN { if note.Status != mixTy.NoteStatus_VALID && note.Status != mixTy.NoteStatus_UNFROZEN {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String()) return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
} }
if note.Secret.AssetExec != req.AssetExec || note.Secret.AssetSymbol != req.AssetSymbol {
return nil, errors.Wrapf(types.ErrInvalidParam, "note=%s,exec=%s,sym=%s not equal req's exec=%s,symbol=%s",
h, note.Secret.AssetExec, note.Secret.AssetSymbol, req.AssetExec, req.AssetSymbol)
}
notes = append(notes, note) notes = append(notes, note)
} }
...@@ -311,6 +323,12 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -311,6 +323,12 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
} }
//2. 获取output //2. 获取output
//1.如果平行链,fee可以设为0
//2. 如果token,且不收token费,则txfee=0, 单纯扣特殊地址mixtoken的bty
//3. 如果token,且tokenFee=true,则按fee收token数量作为交易费
txFee := mixTy.GetTransferTxFee(p.walletOperate.GetAPI().GetConfig(), req.AssetExec)
outAmount, err := strconv.ParseUint(transfer.Output.Deposit.Amounts, 10, 64) outAmount, err := strconv.ParseUint(transfer.Output.Deposit.Amounts, 10, 64)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "output part parseUint=%s", transfer.Output.Deposit.Amounts) return nil, errors.Wrapf(err, "output part parseUint=%s", transfer.Output.Deposit.Amounts)
...@@ -318,10 +336,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -318,10 +336,10 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
if outAmount == 0 { if outAmount == 0 {
return nil, errors.Wrapf(err, "output part amount=0, parseUint=%s", transfer.Output.Deposit.Amounts) return nil, errors.Wrapf(err, "output part amount=0, parseUint=%s", transfer.Output.Deposit.Amounts)
} }
if sumInput < outAmount+uint64(mixTy.Privacy2PrivacyTxFee) { if sumInput < outAmount+uint64(txFee) {
return nil, errors.Wrapf(types.ErrInvalidParam, "out amount=%d big than input=%d - fee=%d", outAmount, sumInput, uint64(mixTy.Privacy2PrivacyTxFee)) return nil, errors.Wrapf(types.ErrInvalidParam, "out amount=%d big than input=%d - fee=%d", outAmount, sumInput, uint64(txFee))
} }
outPart, outDHSecret, err := p.getTransferOutput(transfer.Output.Deposit) outPart, outDHSecret, err := p.getTransferOutput(req.AssetExec, req.AssetSymbol, transfer.Output.Deposit)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "getTransferOutput for deposit") return nil, errors.Wrap(err, "getTransferOutput for deposit")
} }
...@@ -330,19 +348,19 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -330,19 +348,19 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
//3. 获取找零,并扣除手续费 //3. 获取找零,并扣除手续费
//如果找零为0也需要设置,否则只有一个输入一个输出,H部分的随机数要相等,就能推测出转账值来 //如果找零为0也需要设置,否则只有一个输入一个输出,H部分的随机数要相等,就能推测出转账值来
//在transfer output 部分特殊处理,如果amount是0的值则不加进tree //在transfer output 部分特殊处理,如果amount是0的值则不加进tree
changeAmount := sumInput - outAmount - uint64(mixTy.Privacy2PrivacyTxFee) changeAmount := sumInput - outAmount - uint64(txFee)
change := &mixTy.DepositInfo{ change := &mixTy.DepositInfo{
ReceiverAddrs: notes[0].Account, ReceiverAddrs: notes[0].Account,
Amounts: strconv.FormatUint(changeAmount, 10), Amounts: strconv.FormatUint(changeAmount, 10),
} }
changePart, changeDHSecret, err := p.getTransferOutput(change) changePart, changeDHSecret, err := p.getTransferOutput(req.AssetExec, req.AssetSymbol, change)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "getTransferOutput change part ") return nil, errors.Wrap(err, "getTransferOutput change part ")
} }
bizlog.Info("transferProof deposit to change succ") bizlog.Info("transferProof deposit to change succ")
//获取shieldValue 输入输出对amount隐藏 //获取shieldValue 输入输出对amount隐藏
shieldValue, err := getShieldValue(inputAmounts, outAmount, changeAmount, uint64(mixTy.Privacy2PrivacyTxFee)) shieldValue, err := getShieldValue(p.walletOperate.GetAPI().GetConfig(), inputAmounts, outAmount, changeAmount, uint64(txFee))
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -396,14 +414,16 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -396,14 +414,16 @@ func (p *mixPolicy) createTransferTx(req *mixTy.CreateRawTxReq) (*types.Transact
} }
changeProof.Secrets = changeDHSecret changeProof.Secrets = changeDHSecret
return p.getTransferTx(strings.TrimSpace(req.Title+mixTy.MixX), inputProofs, outputProof, changeProof) return p.getTransferTx(strings.TrimSpace(req.Title+mixTy.MixX), req.AssetExec, req.AssetSymbol, inputProofs, outputProof, changeProof)
} }
func (p *mixPolicy) getTransferTx(execName string, inputProofs []*mixTy.ZkProofInfo, proofs ...*mixTy.ZkProofInfo) (*types.Transaction, error) { func (p *mixPolicy) getTransferTx(execName, assetExec, assetSymbol string, inputProofs []*mixTy.ZkProofInfo, output, change *mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixTransferAction{} payload := &mixTy.MixTransferAction{}
payload.AssetExec = assetExec
payload.AssetSymbol = assetSymbol
payload.Inputs = inputProofs payload.Inputs = inputProofs
payload.Output = proofs[0] payload.Output = output
payload.Change = proofs[1] payload.Change = change
cfg := p.getWalletOperate().GetAPI().GetConfig() cfg := p.getWalletOperate().GetAPI().GetConfig()
action := &mixTy.MixAction{ action := &mixTy.MixAction{
......
...@@ -67,7 +67,7 @@ type WithdrawInput struct { ...@@ -67,7 +67,7 @@ type WithdrawInput struct {
Valid9 string `tag:"secret"` Valid9 string `tag:"secret"`
} }
func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) { func (p *mixPolicy) getWithdrawParams(exec, symbol, noteHash string) (*WithdrawInput, error) {
note, err := p.getNoteInfo(noteHash) note, err := p.getNoteInfo(noteHash)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -76,6 +76,11 @@ func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) { ...@@ -76,6 +76,11 @@ func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) {
return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String()) return nil, errors.Wrapf(types.ErrNotAllow, "wrong note status=%s", note.Status.String())
} }
if note.Secret.AssetExec != exec || note.Secret.AssetSymbol != symbol {
return nil, errors.Wrapf(types.ErrInvalidParam, "exec=%s,sym=%s not equal req's exec=%s,symbol=%s",
note.Secret.AssetExec, note.Secret.AssetSymbol, exec, symbol)
}
var input WithdrawInput var input WithdrawInput
initTreePath(&input) initTreePath(&input)
input.NullifierHash = note.Nullifier input.NullifierHash = note.Nullifier
...@@ -105,7 +110,7 @@ func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) { ...@@ -105,7 +110,7 @@ func (p *mixPolicy) getWithdrawParams(noteHash string) (*WithdrawInput, error) {
} }
//get tree path //get tree path
treeProof, err := p.getTreeProof(note.NoteHash) treeProof, err := p.getTreeProof(note.Secret.AssetExec, note.Secret.AssetSymbol, note.NoteHash)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash) return nil, errors.Wrapf(err, "getTreeProof for hash=%s", note.NoteHash)
} }
...@@ -122,6 +127,11 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -122,6 +127,11 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact
if err != nil { if err != nil {
return nil, errors.Wrap(err, "decode req fail") return nil, errors.Wrap(err, "decode req fail")
} }
if len(req.AssetExec) == 0 || len(req.AssetSymbol) == 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "asset exec=%s or symbol=%s not filled", req.AssetExec, req.AssetSymbol)
}
if withdraw.TotalAmount <= 0 { if withdraw.TotalAmount <= 0 {
return nil, errors.Wrapf(types.ErrInvalidParam, "totalAmount=%d", withdraw.TotalAmount) return nil, errors.Wrapf(types.ErrInvalidParam, "totalAmount=%d", withdraw.TotalAmount)
} }
...@@ -134,7 +144,7 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -134,7 +144,7 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact
var sum uint64 var sum uint64
for _, note := range notes { for _, note := range notes {
input, err := p.getWithdrawParams(note) input, err := p.getWithdrawParams(req.AssetExec, req.AssetSymbol, note)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "getWithdrawParams note=%s", note) return nil, errors.Wrapf(err, "getWithdrawParams note=%s", note)
} }
...@@ -161,12 +171,14 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact ...@@ -161,12 +171,14 @@ func (p *mixPolicy) createWithdrawTx(req *mixTy.CreateRawTxReq) (*types.Transact
return nil, errors.Wrapf(types.ErrInvalidParam, "amount not match req=%d,note.sum=%d", withdraw.TotalAmount, sum) return nil, errors.Wrapf(types.ErrInvalidParam, "amount not match req=%d,note.sum=%d", withdraw.TotalAmount, sum)
} }
return p.getWithdrawTx(strings.TrimSpace(req.Title+mixTy.MixX), withdraw.TotalAmount, proofs) return p.getWithdrawTx(strings.TrimSpace(req.Title+mixTy.MixX), req.AssetExec, req.AssetSymbol, withdraw.TotalAmount, proofs)
} }
func (p *mixPolicy) getWithdrawTx(execName string, amount uint64, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) { func (p *mixPolicy) getWithdrawTx(execName, assetExec, assetSymbol string, amount uint64, proofs []*mixTy.ZkProofInfo) (*types.Transaction, error) {
payload := &mixTy.MixWithdrawAction{} payload := &mixTy.MixWithdrawAction{}
payload.AssetExec = assetExec
payload.AssetSymbol = assetSymbol
payload.Amount = amount payload.Amount = amount
payload.Proofs = proofs payload.Proofs = proofs
......
...@@ -127,11 +127,11 @@ func (p *mixPolicy) getPaymentKey(addr string) (*mixTy.PaymentKey, error) { ...@@ -127,11 +127,11 @@ func (p *mixPolicy) getPaymentKey(addr string) (*mixTy.PaymentKey, error) {
return msg.(*mixTy.PaymentKey), err return msg.(*mixTy.PaymentKey), err
} }
func (p *mixPolicy) getPathProof(leaf string) (*mixTy.CommitTreeProve, error) { func (p *mixPolicy) getPathProof(exec, symbol, leaf string) (*mixTy.CommitTreeProve, error) {
msg, err := p.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{ msg, err := p.walletOperate.GetAPI().QueryChain(&types.ChainExecutor{
Driver: "mix", Driver: "mix",
FuncName: "GetTreePath", FuncName: "GetTreePath",
Param: types.Encode(&mixTy.TreeInfoReq{LeafHash: leaf}), Param: types.Encode(&mixTy.TreeInfoReq{AssetExec: exec, AssetSymbol: symbol, LeafHash: leaf}),
}) })
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -160,11 +160,11 @@ func (p *mixPolicy) getNoteInfo(noteHash string) (*mixTy.WalletNoteInfo, error) ...@@ -160,11 +160,11 @@ func (p *mixPolicy) getNoteInfo(noteHash string) (*mixTy.WalletNoteInfo, error)
return note, nil return note, nil
} }
func (p *mixPolicy) getTreeProof(leaf string) (*mixTy.TreePathProof, error) { func (p *mixPolicy) getTreeProof(exec, symbol, leaf string) (*mixTy.TreePathProof, error) {
//get tree path //get tree path
path, err := p.getPathProof(leaf) path, err := p.getPathProof(exec, symbol, leaf)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "get tree proof for noteHash=%s", leaf) return nil, errors.Wrapf(err, "get tree proof for noteHash=%s,exec=%s,symbol=%s", leaf, exec, symbol)
} }
var proof mixTy.TreePathProof var proof mixTy.TreePathProof
proof.TreePath = path.ProofSet[1:] proof.TreePath = path.ProofSet[1:]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment