mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-24 03:45:38 +08:00
chore: add comments and clean up code
This commit is contained in:
@@ -212,7 +212,8 @@ impl DefinedFunction {
|
||||
);
|
||||
}
|
||||
// Since this Clarity 1 contract may be called from a Clarity 2 contract,
|
||||
// we need to handle Clarity 2 values as well.
|
||||
// we need to handle Clarity 2 values as well. Clarity 2 contracts can only
|
||||
// be executed in epoch 2.1, so we only need to handle `CallableType` here.
|
||||
(
|
||||
TypeSignature::CallableType(CallableSubtype::Trait(_)),
|
||||
Value::CallableContract(CallableData {
|
||||
|
||||
@@ -1838,6 +1838,9 @@ impl ContractContext {
|
||||
&self.clarity_version
|
||||
}
|
||||
|
||||
/// Canonicalize the types for the specified epoch. Only functions and
|
||||
/// defined traits are exposed externally, so other types are not
|
||||
/// canonicalized.
|
||||
pub fn canonicalize_types(&mut self, epoch: &StacksEpochId) {
|
||||
for (_, function) in self.functions.iter_mut() {
|
||||
function.canonicalize_types(epoch);
|
||||
|
||||
@@ -396,6 +396,7 @@ fn trait_invocation_205_with_stored_principal() {
|
||||
});
|
||||
}
|
||||
|
||||
/// Publish a trait in epoch 2.05 and then invoke it in epoch 2.1.
|
||||
#[test]
|
||||
fn trait_invocation_cross_epoch() {
|
||||
let mut sim = ClarityTestSim::new();
|
||||
@@ -475,6 +476,9 @@ fn trait_invocation_cross_epoch() {
|
||||
});
|
||||
}
|
||||
|
||||
/// Publish a trait that includes another trait in one of its functions in
|
||||
/// epoch 2.05 and then invoke it in epoch 2.1. Test variations of epoch and
|
||||
/// Clarity versions for the contract that uses the trait.
|
||||
#[test]
|
||||
fn trait_with_trait_invocation_cross_epoch() {
|
||||
let mut sim = ClarityTestSim::new();
|
||||
|
||||
@@ -4878,7 +4878,6 @@ fn trait_invocation_cross_epoch() {
|
||||
parsed.txid(),
|
||||
tx.get("raw_result").unwrap().as_str().unwrap()
|
||||
);
|
||||
// eprintln!("{}", tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user