Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
277 changes: 90 additions & 187 deletions Cargo.lock

Large diffs are not rendered by default.

27 changes: 15 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ repository = "https://github.com/logos-blockchain/logos-zone-sdk"
version = "0.0.0"

[workspace.dependencies]
ark-ff = { default-features = false, version = "0.5" }
async-trait = { default-features = false, version = "0.1" }
bincode = { default-features = false, version = "1.3" }
blake2 = { default-features = false, version = "0.10" }
Expand All @@ -24,19 +25,21 @@ cucumber = { default-features = false, version = "=0.23.
flate2 = { default-features = false, version = "1.1.9" }
futures = { default-features = false, version = "0.3.32" }
hex = { default-features = false, version = "0.4" }
lb-binary-codec = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-binary-codec", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-common-http-client = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-common-http-client", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-core = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-core", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-groth16 = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-groth16", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-http-api-common = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-http-api-common", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-key-management-system-service = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-key-management-system-service", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-log-targets = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-log-targets", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-mmr = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-mmr", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-testing-framework = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "blockchain-test-logos", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-time = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-time", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-utils = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-utils", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
lb-binary-codec = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-binary-codec", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-common-http-client = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-common-http-client", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-core = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-core", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-groth16 = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-groth16", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-http-api-common = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-http-api-common", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-key-management-system-service = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-key-management-system-service", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-log-targets = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-log-targets", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-mmr = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-mmr", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-program-spend = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-program-spend", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-testing-framework = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "blockchain-test-logos", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-time = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-time", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-utils = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-utils", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-wallet = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", package = "logos-blockchain-wallet", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
lb-zone-sdk = { default-features = false, package = "logos-blockchain-zone-sdk", path = "zone-sdk" }
logos-blockchain-tests = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "a54cbc526112d391f11901e7b284e1bbe5d801b8" }
logos-blockchain-tests = { default-features = false, git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "f08cbf14e14d3da86c717a61658836bd5d49e3ce" }
logos-blockchain-zone-tests = { default-features = false, path = "tests/zone-sdk" }
rand = { default-features = false, version = "0.8" }
reqwest = { default-features = false, version = "0.12" }
Expand Down
2 changes: 1 addition & 1 deletion tests/zone-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cucumber = { features = ["macros", "output-junit"], work
futures = { workspace = true }
lb-common-http-client = { workspace = true }
lb-core = { features = ["test-utils"], workspace = true }
lb-groth16 = { workspace = true }
lb-groth16 = { features = ["test-utils"], workspace = true }
lb-http-api-common = { workspace = true }
lb-key-management-system-service = { workspace = true }
lb-testing-framework = { workspace = true }
Expand Down
39 changes: 39 additions & 0 deletions tests/zone-sdk/features/zone.feature
Original file line number Diff line number Diff line change
Expand Up @@ -718,3 +718,42 @@ Feature: Zone SDK
| alias |
| MSG_1 |
Then the channel view contract holds for all zone sequencers

@zone_ci
Scenario: A holder's deposit moves through the program and back to the holder
Given the genesis block has the following wallet resources:
| account_index | token_count | token_amount |
| 1 | 3 | 100000 |
And I have a cluster with capacity of 1 nodes
And I start nodes with wallet and sequencer resources:
| node_name | account_index | wallet_name | connected_to | sequencers |
| NODE_1 | 1 | WALLET_1A | | SEQ_A |
When node "NODE_1" is at height 1 in 120 seconds
And wallet "WALLET_1A" sends 4 notes of 10000 LGO to node "NODE_1" funding wallet as "FUNDING_TOPUP"
And transaction "FUNDING_TOPUP" is included on node "NODE_1" in 180 seconds
And I start zone sequencer "SEQ_A" with indexer
And sequencer "SEQ_A" publishes the following zone messages:
| alias | data |
| MSG_1 | initial inscription |
Then all zone messages are safe in 120 seconds
When sequencer "SEQ_A" registers zone program "PROGRAM_1"
Then zone transaction "PROGRAM_1" is included in 120 seconds
And sequencer "SEQ_A" observes program registration "PROGRAM_1" in 120 seconds
When wallet "WALLET_1A" deposits 1000 LGO into the channel of sequencer "SEQ_A" as "DEPOSIT"
Then zone transaction "DEPOSIT" is included in 120 seconds
When wallet "WALLET_1A" pays 600 LGO of its channel notes to program "PROGRAM_1" of sequencer "SEQ_A" as step "PAY_IN"
And sequencer "SEQ_A" publishes zone block "BLOCK_1" with step "PAY_IN" and a step of program "PROGRAM_1" collecting it
Then zone transaction "BLOCK_1" is included in 120 seconds
And sequencer "SEQ_A" tracks the program notes zone block "BLOCK_1" created in 120 seconds
When sequencer "SEQ_A" publishes zone block "BLOCK_2" with a step of program "PROGRAM_1" paying its notes to wallet "WALLET_1A" as "PAYOUT"
Then zone transaction "BLOCK_2" is included in 120 seconds
And sequencer "SEQ_A" tracks the program notes zone block "BLOCK_2" created in 120 seconds
When wallet "WALLET_1A" withdraws channel note "PAYOUT" from the channel of sequencer "SEQ_A" as "WITHDRAW"
Then zone transaction "WITHDRAW" is included in 120 seconds
And wallet "WALLET_1A" holds a ledger note of 600 LGO in 180 seconds
And the zone indexer returns messages in this order:
| alias |
| MSG_1 |
| BLOCK_1 |
| BLOCK_2 |
Then the channel view contract holds for all zone sequencers
7 changes: 7 additions & 0 deletions tests/zone-sdk/src/cucumber/steps/zone/actions/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ fn apply_zone_timing_defaults(world: &mut ZoneWorld, step: &str) -> StepResult {
step,
"eras.0.cryptarchia.slot_activation_coeff.denominator",
"2",
)?;
// Short enough for a scenario to see a channel withdrawal released.
set_deployment_config_override(
&mut world.node,
step,
"eras.0.cryptarchia.channel_withdraw_delay",
"30",
)
}

Expand Down
6 changes: 5 additions & 1 deletion tests/zone-sdk/src/cucumber/steps/zone/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ pub(super) use channel::{
pub(super) use cluster::{
register_zone_sequencers_with_shared_key, start_nodes_with_zone_resources,
};
pub(super) use program::register_zone_program;
pub(super) use program::{
ProgramBlockContent, deposit_into_channel, pay_into_program, publish_program_block,
register_zone_program, wait_for_tracked_program_notes, wait_for_wallet_note,
withdraw_channel_note,
};
pub(super) use publishing::{
initialize_zone_indexer, publish_zone_messages, publish_zone_messages_concurrently,
};
Expand Down
Loading
Loading