Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: Bump XDR and Rust/Go/Core dependencies #1029

Merged
merged 19 commits into from
Oct 23, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/soroban-rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.13.1-1481.3acf6dd26.focal
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.14.1-1529.fcbbad4ce.focal
steps:
- uses: actions/checkout@v3
with:
Expand Down
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ version = "20.0.0-rc4"
[workspace.dependencies.soroban-env-host]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-env"
rev = "8c63bff68a15d79aca3a705ee6916a68db57b7e6"
rev = "91f44778389490ad863d61a8a90ac9875ba6d8fd"

[workspace.dependencies.soroban-spec]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"
rev = "729ed3ac5fe8600a3245d5816eadd3c95ab2eb54"
# path = "../rs-soroban-sdk/soroban-spec"

[workspace.dependencies.soroban-spec-rust]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"
rev = "729ed3ac5fe8600a3245d5816eadd3c95ab2eb54"
# path = "../rs-soroban-sdk/soroban-spec-rust"

[workspace.dependencies.soroban-spec-json]
Expand All @@ -45,12 +45,12 @@ path = "./cmd/crates/soroban-spec-tools"
[workspace.dependencies.soroban-sdk]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"
rev = "729ed3ac5fe8600a3245d5816eadd3c95ab2eb54"

[workspace.dependencies.soroban-ledger-snapshot]
version = "20.0.0-rc2"
git = "https://github.com/stellar/rs-soroban-sdk"
rev = "0992413f9b05e5bfb1f872bce99e89d9129b2e61"
rev = "729ed3ac5fe8600a3245d5816eadd3c95ab2eb54"

[workspace.dependencies.soroban-cli]
version = "20.0.0-rc4"
Expand All @@ -59,8 +59,8 @@ path = "cmd/soroban-cli"
[workspace.dependencies.stellar-xdr]
version = "20.0.0-rc1"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "d5ce0c9e7aa83461773a6e81662067f35d39e4c1"
default-features = false
rev = "9c97e4fa909a0b6455547a4f4a95800696b2a69a"
default-features = true

[workspace.dependencies]
base64 = "0.21.2"
Expand Down
4 changes: 2 additions & 2 deletions cmd/crates/soroban-spec-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::{fs, io};
pub mod types;

use sha2::{Digest, Sha256};
use stellar_xdr::ScSpecEntry;

use stellar_xdr::curr::ScSpecEntry;
use types::Entry;

use soroban_spec::read::{from_wasm, FromWasmError};
Expand All @@ -16,7 +16,7 @@ pub enum GenerateFromFileError {
#[error("sha256 does not match, expected: {expected}")]
VerifySha256 { expected: String },
#[error("parsing contract spec: {0}")]
Parse(stellar_xdr::Error),
Parse(stellar_xdr::curr::Error),
#[error("getting contract spec: {0}")]
GetSpec(FromWasmError),
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/crates/soroban-spec-json/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::Serialize;
use stellar_xdr::{
use stellar_xdr::curr::{
ScSpecEntry, ScSpecFunctionInputV0, ScSpecTypeDef, ScSpecUdtEnumCaseV0,
ScSpecUdtErrorEnumCaseV0, ScSpecUdtStructFieldV0, ScSpecUdtUnionCaseV0,
};
Expand Down
30 changes: 13 additions & 17 deletions cmd/crates/soroban-spec-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::str::FromStr;

use itertools::Itertools;
use serde_json::{json, Value};
use stellar_xdr::{
use stellar_xdr::curr::{
AccountId, BytesM, ContractExecutable, Error as XdrError, Hash, Int128Parts, Int256Parts,
PublicKey, ScAddress, ScBytes, ScContractInstance, ScMap, ScMapEntry, ScNonceKey, ScSpecEntry,
ScSpecFunctionV0, ScSpecTypeDef as ScType, ScSpecTypeMap, ScSpecTypeOption, ScSpecTypeResult,
Expand Down Expand Up @@ -1025,9 +1025,9 @@ pub fn to_json(v: &ScVal) -> Result<Value, Error> {
..
}) => json!({ "hash": hash }),
ScVal::ContractInstance(ScContractInstance {
executable: ContractExecutable::Token,
executable: ContractExecutable::StellarAsset,
..
}) => json!({"token": true}),
}) => json!({"SAC": true}),
ScVal::LedgerKeyNonce(ScNonceKey { nonce }) => {
Value::Number(serde_json::Number::from(*nonce))
}
Expand Down Expand Up @@ -1175,11 +1175,10 @@ impl Spec {
.iter()
.map(|f| {
Some(match f {
stellar_xdr::ScSpecUdtUnionCaseV0::VoidV0(ScSpecUdtUnionCaseVoidV0 {
name,
..
}) => name.to_string_lossy(),
stellar_xdr::ScSpecUdtUnionCaseV0::TupleV0(ScSpecUdtUnionCaseTupleV0 {
ScSpecUdtUnionCaseV0::VoidV0(ScSpecUdtUnionCaseVoidV0 { name, .. }) => {
name.to_string_lossy()
}
ScSpecUdtUnionCaseV0::TupleV0(ScSpecUdtUnionCaseTupleV0 {
name,
type_,
..
Expand Down Expand Up @@ -1331,14 +1330,11 @@ impl Spec {
.cases
.iter()
.map(|case| match case {
stellar_xdr::ScSpecUdtUnionCaseV0::VoidV0(ScSpecUdtUnionCaseVoidV0 {
name,
..
}) => Some(format!("\"{}\"", name.to_string_lossy())),
stellar_xdr::ScSpecUdtUnionCaseV0::TupleV0(ScSpecUdtUnionCaseTupleV0 {
name,
type_,
..
ScSpecUdtUnionCaseV0::VoidV0(ScSpecUdtUnionCaseVoidV0 { name, .. }) => {
Some(format!("\"{}\"", name.to_string_lossy()))
}
ScSpecUdtUnionCaseV0::TupleV0(ScSpecUdtUnionCaseTupleV0 {
name, type_, ..
}) => {
if type_.len() == 1 {
let single = self.example(&type_[0])?;
Expand All @@ -1362,7 +1358,7 @@ impl Spec {
mod tests {
use super::*;

use stellar_xdr::ScSpecTypeBytesN;
use stellar_xdr::curr::ScSpecTypeBytesN;

#[test]
fn from_json_primitives_bytesn() {
Expand Down
13 changes: 5 additions & 8 deletions cmd/crates/soroban-spec-tools/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
io::{self, Cursor},
};

use stellar_xdr::{
use stellar_xdr::curr::{
DepthLimitedRead, ReadXdr, ScEnvMetaEntry, ScMetaEntry, ScMetaV0, ScSpecEntry,
ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0, ScSpecUdtStructV0, ScSpecUdtUnionV0,
StringM,
Expand Down Expand Up @@ -33,7 +33,7 @@ pub enum Error {
error: wasmparser::BinaryReaderError,
},
#[error("xdr processing error: {0}")]
Xdr(#[from] stellar_xdr::Error),
Xdr(#[from] stellar_xdr::curr::Error),

#[error(transparent)]
Parser(#[from] wasmparser::BinaryReaderError),
Expand Down Expand Up @@ -62,8 +62,7 @@ impl ContractSpec {
env_meta_base64 = Some(base64.encode(env_meta));
let cursor = Cursor::new(env_meta);
let mut depth_limit_read = DepthLimitedRead::new(cursor, 100);
ScEnvMetaEntry::read_xdr_iter(&mut depth_limit_read)
.collect::<Result<Vec<_>, stellar_xdr::Error>>()?
ScEnvMetaEntry::read_xdr_iter(&mut depth_limit_read).collect::<Result<Vec<_>, _>>()?
} else {
vec![]
};
Expand All @@ -73,8 +72,7 @@ impl ContractSpec {
meta_base64 = Some(base64.encode(meta));
let cursor = Cursor::new(meta);
let mut depth_limit_read = DepthLimitedRead::new(cursor, 100);
ScMetaEntry::read_xdr_iter(&mut depth_limit_read)
.collect::<Result<Vec<_>, stellar_xdr::Error>>()?
ScMetaEntry::read_xdr_iter(&mut depth_limit_read).collect::<Result<Vec<_>, _>>()?
} else {
vec![]
};
Expand All @@ -84,8 +82,7 @@ impl ContractSpec {
spec_base64 = Some(base64.encode(spec));
let cursor = Cursor::new(spec);
let mut depth_limit_read = DepthLimitedRead::new(cursor, 100);
ScSpecEntry::read_xdr_iter(&mut depth_limit_read)
.collect::<Result<Vec<_>, stellar_xdr::Error>>()?
ScSpecEntry::read_xdr_iter(&mut depth_limit_read).collect::<Result<Vec<_>, _>>()?
} else {
vec![]
};
Expand Down
2 changes: 1 addition & 1 deletion cmd/crates/soroban-spec-typescript/src/boilerplate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
io::Write,
path::{Path, PathBuf},
};
use stellar_xdr::ScSpecEntry;
use stellar_xdr::curr::ScSpecEntry;

use super::generate;

Expand Down
4 changes: 2 additions & 2 deletions cmd/crates/soroban-spec-typescript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::types::Type;
use heck::ToLowerCamelCase;
use itertools::Itertools;
use sha2::{Digest, Sha256};
use stellar_xdr::{ScSpecEntry, WriteXdr};
use stellar_xdr::curr::{ScSpecEntry, WriteXdr};

use types::Entry;

Expand All @@ -27,7 +27,7 @@ pub enum GenerateFromFileError {
#[error("sha256 does not match, expected: {expected}")]
VerifySha256 { expected: String },
#[error("parsing contract spec: {0}")]
Parse(stellar_xdr::Error),
Parse(stellar_xdr::curr::Error),
#[error("getting contract spec: {0}")]
GetSpec(FromWasmError),
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/crates/soroban-spec-typescript/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::Serialize;
use stellar_xdr::{
use stellar_xdr::curr::{
ScSpecEntry, ScSpecFunctionInputV0, ScSpecTypeDef, ScSpecUdtEnumCaseV0,
ScSpecUdtErrorEnumCaseV0, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, ScSpecUdtUnionCaseV0,
};
Expand Down
4 changes: 2 additions & 2 deletions cmd/crates/soroban-test/tests/it/integration/custom_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde_json::json;
use soroban_cli::commands;
use soroban_test::TestEnv;

use crate::integration::util::{bump_contract, deploy_custom, CUSTOM_TYPES};
use crate::integration::util::{deploy_custom, extend_contract, CUSTOM_TYPES};

use super::util::invoke_with_roundtrip;

Expand All @@ -17,7 +17,7 @@ fn invoke_custom(e: &TestEnv, id: &str, func: &str) -> assert_cmd::Command {
async fn parse() {
let sandbox = &TestEnv::default();
let id = &deploy_custom(sandbox);
bump_contract(sandbox, id, CUSTOM_TYPES).await;
extend_contract(sandbox, id, CUSTOM_TYPES).await;
symbol(sandbox, id);
string_with_quotes(sandbox, id).await;
symbol_with_quotes(sandbox, id).await;
Expand Down
8 changes: 4 additions & 4 deletions cmd/crates/soroban-test/tests/it/integration/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use soroban_cli::commands::{
};
use soroban_test::TestEnv;

use crate::{integration::util::bump_contract, util::DEFAULT_SEED_PHRASE};
use crate::{integration::util::extend_contract, util::DEFAULT_SEED_PHRASE};

use super::util::{
add_test_seed, bump, deploy_hello, network_passphrase, network_passphrase_arg, rpc_url,
add_test_seed, deploy_hello, extend, network_passphrase, network_passphrase_arg, rpc_url,
rpc_url_arg, DEFAULT_PUB_KEY, DEFAULT_PUB_KEY_1, DEFAULT_SECRET_KEY, HELLO_WORLD,
};

Expand All @@ -16,7 +16,7 @@ use super::util::{
async fn invoke() {
let sandbox = &TestEnv::default();
let id = &deploy_hello(sandbox);
bump_contract(sandbox, id, HELLO_WORLD).await;
extend_contract(sandbox, id, HELLO_WORLD).await;
// Note that all functions tested here have no state
invoke_hello_world(sandbox, id);
invoke_hello_world_with_lib(sandbox, id).await;
Expand Down Expand Up @@ -193,7 +193,7 @@ async fn contract_data_read() {
let id = &deploy_hello(sandbox);
let res = sandbox.invoke(&["--id", id, "--", "inc"]).await.unwrap();
assert_eq!(res.trim(), "1");
bump(sandbox, id, Some(KEY)).await;
extend(sandbox, id, Some(KEY)).await;

sandbox
.new_assert_cmd("contract")
Expand Down
Loading
Loading