Skip to content

Commit

Permalink
Adjusted proof structs to be rust friendly (#209) (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Aug 15, 2024
1 parent 8a04355 commit 4ec28d9
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -833,36 +833,40 @@ struct ArchivalProofNode

typedef ArchivalProofNode ProofLevel<>;

struct NonexistenceProofBody
{
ColdArchiveBucketEntry entriesToProve<>;

// Vector of vectors, where proofLevels[level]
// contains all HashNodes that correspond with that level
ProofLevel proofLevels<>;
};

struct ExistenceProofBody
{
LedgerKey keysToProve<>;

// Bounds for each key being proved, where bound[n]
// corresponds to keysToProve[n]
ColdArchiveBucketEntry lowBoundEntries<>;
ColdArchiveBucketEntry highBoundEntries<>;

// Vector of vectors, where proofLevels[level]
// contains all HashNodes that correspond with that level
ProofLevel proofLevels<>;
};

struct ArchivalProof
{
uint32 epoch; // AST Subtree for this proof

union switch (ArchivalProofType t)
{
case EXISTENCE:
struct
{
ColdArchiveBucketEntry entriesToProve<>;

// Vector of vectors, where proofLevels[level]
// contains all HashNodes that correspond with that level
ProofLevel proofLevels<>;
} existenceProof;
NonexistenceProofBody nonexistenceProof;
case NONEXISTENCE:
struct
{
LedgerKey keysToProve<>;

// Bounds for each key being proved, where bound[n]
// corresponds to keysToProve[n]
ColdArchiveBucketEntry lowBoundEntries<>;
ColdArchiveBucketEntry highBoundEntries<>;

// Vector of vectors, where proofLevels[level]
// contains all HashNodes that correspond with that level
ProofLevel proofLevels<>;
} nonexistenceProof;
} type;
ExistenceProofBody existenceProof;
} body;
};

// Resource limits for a Soroban transaction.
Expand Down

0 comments on commit 4ec28d9

Please sign in to comment.