|
@@ -24,7 +24,7 @@ use darkfi_money_contract::{
|
|
|
};
|
|
};
|
|
|
use darkfi_sdk::{
|
|
use darkfi_sdk::{
|
|
|
crypto::{
|
|
crypto::{
|
|
|
- pasta_prelude::*, pedersen_commitment_base, ContractId, PublicKey, CONSENSUS_CONTRACT_ID,
|
|
|
|
|
|
|
+ pasta_prelude::*, pedersen_commitment_base, ContractId, CONSENSUS_CONTRACT_ID,
|
|
|
DARK_TOKEN_ID, MONEY_CONTRACT_ID,
|
|
DARK_TOKEN_ID, MONEY_CONTRACT_ID,
|
|
|
},
|
|
},
|
|
|
db::{db_contains_key, db_lookup, db_set},
|
|
db::{db_contains_key, db_lookup, db_set},
|
|
@@ -45,15 +45,15 @@ pub(crate) fn consensus_unstake_get_metadata_v1(
|
|
|
) -> Result<Vec<u8>, ContractError> {
|
|
) -> Result<Vec<u8>, ContractError> {
|
|
|
let self_ = &calls[call_idx as usize];
|
|
let self_ = &calls[call_idx as usize];
|
|
|
let params: ConsensusUnstakeParamsV1 = deserialize(&self_.data[1..])?;
|
|
let params: ConsensusUnstakeParamsV1 = deserialize(&self_.data[1..])?;
|
|
|
|
|
+ let input = ¶ms.input;
|
|
|
|
|
|
|
|
// Public inputs for the ZK proofs we have to verify
|
|
// Public inputs for the ZK proofs we have to verify
|
|
|
let mut zk_public_inputs: Vec<(String, Vec<pallas::Base>)> = vec![];
|
|
let mut zk_public_inputs: Vec<(String, Vec<pallas::Base>)> = vec![];
|
|
|
// Public keys for the transaction signatures we have to verify
|
|
// Public keys for the transaction signatures we have to verify
|
|
|
- let mut signature_pubkeys: Vec<PublicKey> = vec![];
|
|
|
|
|
|
|
+ let signature_pubkeys: Vec<PublicKey> = vec![input.signature_public];
|
|
|
|
|
|
|
|
// Grab the pedersen commitments and signature pubkeys from the
|
|
// Grab the pedersen commitments and signature pubkeys from the
|
|
|
// anonymous input
|
|
// anonymous input
|
|
|
- let input = ¶ms.input;
|
|
|
|
|
let value_coords = input.value_commit.to_affine().coordinates().unwrap();
|
|
let value_coords = input.value_commit.to_affine().coordinates().unwrap();
|
|
|
let token_coords = input.token_commit.to_affine().coordinates().unwrap();
|
|
let token_coords = input.token_commit.to_affine().coordinates().unwrap();
|
|
|
let (sig_x, sig_y) = input.signature_public.xy();
|
|
let (sig_x, sig_y) = input.signature_public.xy();
|
|
@@ -76,8 +76,6 @@ pub(crate) fn consensus_unstake_get_metadata_v1(
|
|
|
],
|
|
],
|
|
|
));
|
|
));
|
|
|
|
|
|
|
|
- signature_pubkeys.push(input.signature_public);
|
|
|
|
|
-
|
|
|
|
|
// Serialize everything gathered and return it
|
|
// Serialize everything gathered and return it
|
|
|
let mut metadata = vec![];
|
|
let mut metadata = vec![];
|
|
|
zk_public_inputs.encode(&mut metadata)?;
|
|
zk_public_inputs.encode(&mut metadata)?;
|