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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,3 @@ jobs:
run: |
cargo audit --deny warnings
continue-on-error: true

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[package]
name = "remitwise-contracts"
version = "0.1.0"
edition = "2021"
publish = false

[workspace]
members = [
"remittance_split",
Expand All @@ -22,4 +28,3 @@ lto = true
[profile.release-with-logs]
inherits = "release"
debug-assertions = true

4 changes: 2 additions & 2 deletions remittance_split/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct RemittanceSplit;

#[contractimpl]
impl RemittanceSplit {
/// Initialize a remittance split configuration
/// Set or update the split percentages used to allocate remittances.
///
/// # Arguments
/// * `owner` - Address of the split owner (must authorize)
Expand Down Expand Up @@ -231,7 +231,7 @@ impl RemittanceSplit {
env.storage()
.instance()
.get(&symbol_short!("SPLIT"))
.unwrap_or_else(|| vec![env, 50, 30, 15, 5])
.unwrap_or_else(|| vec![&env, 50, 30, 15, 5])
}

/// Get the full split configuration including owner
Expand Down
238 changes: 238 additions & 0 deletions remittance_split/test_snapshots/test/test_calculate_split_basic.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"generators": {
"address": 1,
"nonce": 0
},
"auth": [
[],
[]
],
"ledger": {
"protocol_version": 21,
"sequence_number": 0,
"timestamp": 0,
"network_id": "0000000000000000000000000000000000000000000000000000000000000000",
"base_reserve": 0,
"min_persistent_entry_ttl": 4096,
"min_temp_entry_ttl": 16,
"max_entry_ttl": 6312000,
"ledger_entries": [
[
{
"contract_data": {
"contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM",
"key": "ledger_key_contract_instance",
"durability": "persistent"
}
},
[
{
"last_modified_ledger_seq": 0,
"data": {
"contract_data": {
"ext": "v0",
"contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM",
"key": "ledger_key_contract_instance",
"durability": "persistent",
"val": {
"contract_instance": {
"executable": {
"wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"storage": [
{
"key": {
"symbol": "SPLIT"
},
"val": {
"vec": [
{
"u32": 50
},
{
"u32": 30
},
{
"u32": 15
},
{
"u32": 5
}
]
}
}
]
}
}
}
},
"ext": "v0"
},
4095
]
],
[
{
"contract_code": {
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
},
[
{
"last_modified_ledger_seq": 0,
"data": {
"contract_code": {
"ext": "v0",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"code": ""
}
},
"ext": "v0"
},
4095
]
]
]
},
"events": [
{
"event": {
"ext": "v0",
"contract_id": null,
"type_": "diagnostic",
"body": {
"v0": {
"topics": [
{
"symbol": "fn_call"
},
{
"bytes": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"symbol": "initialize_split"
}
],
"data": {
"vec": [
{
"u32": 50
},
{
"u32": 30
},
{
"u32": 15
},
{
"u32": 5
}
]
}
}
}
},
"failed_call": false
},
{
"event": {
"ext": "v0",
"contract_id": "0000000000000000000000000000000000000000000000000000000000000001",
"type_": "diagnostic",
"body": {
"v0": {
"topics": [
{
"symbol": "fn_return"
},
{
"symbol": "initialize_split"
}
],
"data": {
"bool": true
}
}
}
},
"failed_call": false
},
{
"event": {
"ext": "v0",
"contract_id": null,
"type_": "diagnostic",
"body": {
"v0": {
"topics": [
{
"symbol": "fn_call"
},
{
"bytes": "0000000000000000000000000000000000000000000000000000000000000001"
},
{
"symbol": "calculate_split"
}
],
"data": {
"i128": {
"hi": 0,
"lo": 1000
}
}
}
}
},
"failed_call": false
},
{
"event": {
"ext": "v0",
"contract_id": "0000000000000000000000000000000000000000000000000000000000000001",
"type_": "diagnostic",
"body": {
"v0": {
"topics": [
{
"symbol": "fn_return"
},
{
"symbol": "calculate_split"
}
],
"data": {
"vec": [
{
"i128": {
"hi": 0,
"lo": 500
}
},
{
"i128": {
"hi": 0,
"lo": 300
}
},
{
"i128": {
"hi": 0,
"lo": 150
}
},
{
"i128": {
"hi": 0,
"lo": 50
}
}
]
}
}
}
},
"failed_call": false
}
]
}
Loading
Loading