Skip to content

Commit ad72809

Browse files
committed
EVIL
make the work with v0.8.0 Please squash this into the merge commit
1 parent 49e1bd0 commit ad72809

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

arm/src/rustler_util.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ atoms! {
7979
at_nk_commitment = "nk_commitment",
8080
at_rand_seed = "rand_seed",
8181
at_delta_proof = "Elixir.Anoma.Arm.DeltaProof",
82+
at_aggregation_proof = "aggregation_proof",
8283
at_signature = "signature",
8384
at_recid = "recid",
8485
at_delta_witness = "Elixir.Anoma.Arm.DeltaWitness",
@@ -260,7 +261,7 @@ impl RustlerEncoder for ComplianceUnit {
260261
impl<'a> RustlerDecoder<'a> for ComplianceUnit {
261262
fn rustler_decode(term: Term<'a>) -> NifResult<Self> {
262263
let proof_term = term.map_get(at_proof().encode(term.get_env()));
263-
let proof: Vec<u8> = RustlerDecoder::rustler_decode(proof_term?)?;
264+
let proof = RustlerDecoder::rustler_decode(proof_term?)?;
264265
let instance_term = term.map_get(at_instance().encode(term.get_env()));
265266
let instance: Vec<u8> = RustlerDecoder::rustler_decode(instance_term?)?;
266267
Ok(ComplianceUnit { proof, instance })
@@ -415,7 +416,7 @@ impl<'a> RustlerDecoder<'a> for LogicVerifierInputs {
415416
let app_data_term = term.map_get(at_app_data_key().encode(term.get_env()))?;
416417
let app_data: AppData = app_data_term.decode()?;
417418
let proof_term = term.map_get(at_proof().encode(term.get_env()))?;
418-
let proof: Vec<u8> = RustlerDecoder::rustler_decode(proof_term)?;
419+
let proof = RustlerDecoder::rustler_decode(proof_term)?;
419420

420421
Ok(LogicVerifierInputs {
421422
tag,
@@ -1062,7 +1063,7 @@ impl RustlerEncoder for LogicVerifier {
10621063
impl<'a> RustlerDecoder<'a> for LogicVerifier {
10631064
fn rustler_decode(term: Term<'a>) -> NifResult<Self> {
10641065
let proof_term = term.map_get(at_proof().encode(term.get_env()))?;
1065-
let proof: Vec<u8> = RustlerDecoder::rustler_decode(proof_term)?;
1066+
let proof = RustlerDecoder::rustler_decode(proof_term)?;
10661067

10671068
let instance_term = term.map_get(at_instance().encode(term.get_env()))?;
10681069
let instance: Vec<u8> = RustlerDecoder::rustler_decode(instance_term)?;
@@ -1109,6 +1110,13 @@ impl RustlerEncoder for Transaction {
11091110
Some(balance) => balance.rustler_encode(env)?,
11101111
None => ().encode(env),
11111112
},
1113+
)?
1114+
.map_put(
1115+
at_aggregation_proof().encode(env),
1116+
match &self.aggregation_proof {
1117+
Some(proof) => proof.rustler_encode(env)?,
1118+
None => ().encode(env),
1119+
},
11121120
)?;
11131121

11141122
Ok(map)
@@ -1129,10 +1137,15 @@ impl<'a> RustlerDecoder<'a> for Transaction {
11291137
Err(_) => Some(RustlerDecoder::rustler_decode(expected_balance_term)?),
11301138
};
11311139

1140+
let aggregation_proof_term = term.map_get(at_aggregation_proof().encode(term.get_env()))?;
1141+
let aggregation_proof: Option<Vec<u8>> =
1142+
RustlerDecoder::rustler_decode(aggregation_proof_term)?;
1143+
11321144
Ok(Transaction {
11331145
actions,
11341146
delta_proof,
11351147
expected_balance,
1148+
aggregation_proof,
11361149
})
11371150
}
11381151
}

0 commit comments

Comments
 (0)