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
3 changes: 1 addition & 2 deletions bindings/go/examples/gas_sponsor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ func main() {
log.Printf("Signing Digest: %v", sdk.HexEncode(txn.SigningDigest()))
log.Printf("Txn Bytes: %v", sdk.Base64Encode(txnBytes))

skipChecks := bool(false)
res, err := client.DryRunTx(txn, &skipChecks)
res, err := client.DryRunTx(txn, false)
if err.(*sdk.SdkFfiError) != nil {
log.Fatalf("Failed to send gas sponsor tx: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions bindings/go/examples/prepare_send_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func main() {
log.Printf("Signing Digest: %v", sdk.HexEncode(txn.SigningDigest()))
log.Printf("Txn Bytes: %v", sdk.Base64Encode(txnBytes))

skipChecks := bool(false)
res, err := client.DryRunTx(txn, &skipChecks)
res, err := client.DryRunTx(txn, false)
if err.(*sdk.SdkFfiError) != nil {
log.Fatalf("Failed to send IOTA: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions bindings/go/examples/prepare_send_iota_multi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func main() {
log.Printf("Signing Digest: %v", sdk.HexEncode(txn.SigningDigest()))
log.Printf("Txn Bytes: %v", sdk.Base64Encode(txnBytes))

skipChecks := bool(false)
res, err := client.DryRunTx(txn, &skipChecks)
res, err := client.DryRunTx(txn, false)
if err.(*sdk.SdkFfiError) != nil {
log.Fatalf("Failed to dry run send IOTA: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions bindings/go/examples/prepare_transfer_objects/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ func main() {
log.Printf("Signing Digest: %v", sdk.HexEncode(txn.SigningDigest()))
log.Printf("Txn Bytes: %v", sdk.Base64Encode(txnBytes))

skipChecks := bool(false)
res, err := client.DryRunTx(txn, &skipChecks)
res, err := client.DryRunTx(txn, false)
if err.(*sdk.SdkFfiError) != nil {
log.Fatalf("Failed to transfer objects: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/examples/sign_send_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
log.Fatalf("Failed to create transaction: %v", err)
}

dryRunResult, err := client.DryRunTx(txn, nil)
dryRunResult, err := client.DryRunTx(txn, false)
if err.(*sdk.SdkFfiError) != nil {
log.Fatalf("Failed to dry run: %v", err)
}
Expand Down
53 changes: 8 additions & 45 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx()
})
if checksum != 12272 {
if checksum != 63702 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx: UniFFI API checksum mismatch")
}
Expand All @@ -1343,7 +1343,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind()
})
if checksum != 40594 {
if checksum != 1733 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind: UniFFI API checksum mismatch")
}
Expand Down Expand Up @@ -12068,7 +12068,7 @@ type GraphQlClientInterface interface {
// prevent access to objects that are owned by addresses other than the
// sender, and calling non-public, non-entry functions, and some other
// checks. Defaults to false.
DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error)
DryRunTx(tx *Transaction, skipChecks bool) (DryRunResult, error)
// Dry run a [`TransactionKind`] and return the transaction effects and dry
// run error (if any).
//
Expand All @@ -12078,7 +12078,7 @@ type GraphQlClientInterface interface {
// checks. Defaults to false.
//
// `tx_meta` is the transaction metadata.
DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error)
DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks bool) (DryRunResult, error)
// Access a dynamic field on an object using its name. Names are arbitrary
// Move values whose type have copy, drop, and store, and are specified
// using their type, and their BCS contents, Base64 encoded.
Expand Down Expand Up @@ -12547,7 +12547,7 @@ func (_self *GraphQlClient) Coins(owner *Address, paginationFilter *PaginationFi
// prevent access to objects that are owned by addresses other than the
// sender, and calling non-public, non-entry functions, and some other
// checks. Defaults to false.
func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error) {
func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks bool) (DryRunResult, error) {
_pointer := _self.ffiObject.incrementPointer("*GraphQlClient")
defer _self.ffiObject.decrementPointer()
res, err :=uniffiRustCallAsync[SdkFfiError](
Expand All @@ -12564,7 +12564,7 @@ func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks *bool) (DryRunR
return FfiConverterDryRunResultINSTANCE.Lift(ffi)
},
C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(
_pointer,FfiConverterTransactionINSTANCE.Lower(tx), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)),
_pointer,FfiConverterTransactionINSTANCE.Lower(tx), FfiConverterBoolINSTANCE.Lower(skipChecks)),
// pollFn
func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data)
Expand All @@ -12587,7 +12587,7 @@ func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks *bool) (DryRunR
// checks. Defaults to false.
//
// `tx_meta` is the transaction metadata.
func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error) {
func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks bool) (DryRunResult, error) {
_pointer := _self.ffiObject.incrementPointer("*GraphQlClient")
defer _self.ffiObject.decrementPointer()
res, err :=uniffiRustCallAsync[SdkFfiError](
Expand All @@ -12604,7 +12604,7 @@ func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta Transac
return FfiConverterDryRunResultINSTANCE.Lift(ffi)
},
C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(
_pointer,FfiConverterTransactionKindINSTANCE.Lower(txKind), FfiConverterTransactionMetadataINSTANCE.Lower(txMeta), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)),
_pointer,FfiConverterTransactionKindINSTANCE.Lower(txKind), FfiConverterTransactionMetadataINSTANCE.Lower(txMeta), FfiConverterBoolINSTANCE.Lower(skipChecks)),
// pollFn
func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) {
C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data)
Expand Down Expand Up @@ -31438,43 +31438,6 @@ func (_ FfiDestroyerOptionalUint64) Destroy(value *uint64) {
}
}

type FfiConverterOptionalBool struct{}

var FfiConverterOptionalBoolINSTANCE = FfiConverterOptionalBool{}

func (c FfiConverterOptionalBool) Lift(rb RustBufferI) *bool {
return LiftFromRustBuffer[*bool](c, rb)
}

func (_ FfiConverterOptionalBool) Read(reader io.Reader) *bool {
if readInt8(reader) == 0 {
return nil
}
temp := FfiConverterBoolINSTANCE.Read(reader)
return &temp
}

func (c FfiConverterOptionalBool) Lower(value *bool) C.RustBuffer {
return LowerIntoRustBuffer[*bool](c, value)
}

func (_ FfiConverterOptionalBool) Write(writer io.Writer, value *bool) {
if value == nil {
writeInt8(writer, 0)
} else {
writeInt8(writer, 1)
FfiConverterBoolINSTANCE.Write(writer, *value)
}
}

type FfiDestroyerOptionalBool struct {}

func (_ FfiDestroyerOptionalBool) Destroy(value *bool) {
if value != nil {
FfiDestroyerBool{}.Destroy(*value)
}
}

type FfiConverterOptionalString struct{}

var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
Expand Down
4 changes: 2 additions & 2 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1677,12 +1677,12 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins(void* ptr, void* owne
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_DRY_RUN_TX
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_DRY_RUN_TX
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(void* ptr, void* tx, RustBuffer skip_checks
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(void* ptr, void* tx, int8_t skip_checks
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_DRY_RUN_TX_KIND
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_DRY_RUN_TX_KIND
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(void* ptr, void* tx_kind, RustBuffer tx_meta, RustBuffer skip_checks
uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(void* ptr, void* tx_kind, RustBuffer tx_meta, int8_t skip_checks
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_DYNAMIC_FIELD
Expand Down
52 changes: 10 additions & 42 deletions bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4428,9 +4428,9 @@ fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata(`ptr`: Pointer,`co
): Long
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins(`ptr`: Pointer,`owner`: Pointer,`paginationFilter`: RustBuffer.ByValue,`coinType`: RustBuffer.ByValue,
): Long
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(`ptr`: Pointer,`tx`: Pointer,`skipChecks`: RustBuffer.ByValue,
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(`ptr`: Pointer,`tx`: Pointer,`skipChecks`: Byte,
): Long
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(`ptr`: Pointer,`txKind`: Pointer,`txMeta`: RustBuffer.ByValue,`skipChecks`: RustBuffer.ByValue,
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(`ptr`: Pointer,`txKind`: Pointer,`txMeta`: RustBuffer.ByValue,`skipChecks`: Byte,
): Long
fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field(`ptr`: Pointer,`address`: Pointer,`typeTag`: Pointer,`name`: RustBuffer.ByValue,
): Long
Expand Down Expand Up @@ -6252,10 +6252,10 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 47450.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 12272.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 63702.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 40594.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 1733.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 17199.toShort()) {
Expand Down Expand Up @@ -19507,7 +19507,7 @@ public interface GraphQlClientInterface {
* sender, and calling non-public, non-entry functions, and some other
* checks. Defaults to false.
*/
suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean? = null): DryRunResult
suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean = false): DryRunResult

/**
* Dry run a [`TransactionKind`] and return the transaction effects and dry
Expand All @@ -19520,7 +19520,7 @@ public interface GraphQlClientInterface {
*
* `tx_meta` is the transaction metadata.
*/
suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean? = null): DryRunResult
suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean = false): DryRunResult

/**
* Access a dynamic field on an object using its name. Names are arbitrary
Expand Down Expand Up @@ -20104,12 +20104,12 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface
*/
@Throws(SdkFfiException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean?) : DryRunResult {
override suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean) : DryRunResult {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(
thisPtr,
FfiConverterTypeTransaction.lower(`tx`),FfiConverterOptionalBoolean.lower(`skipChecks`),
FfiConverterTypeTransaction.lower(`tx`),FfiConverterBoolean.lower(`skipChecks`),
)
},
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) },
Expand All @@ -20136,12 +20136,12 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface
*/
@Throws(SdkFfiException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean?) : DryRunResult {
override suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean) : DryRunResult {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(
thisPtr,
FfiConverterTypeTransactionKind.lower(`txKind`),FfiConverterTypeTransactionMetadata.lower(`txMeta`),FfiConverterOptionalBoolean.lower(`skipChecks`),
FfiConverterTypeTransactionKind.lower(`txKind`),FfiConverterTypeTransactionMetadata.lower(`txMeta`),FfiConverterBoolean.lower(`skipChecks`),
)
},
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) },
Expand Down Expand Up @@ -52579,38 +52579,6 @@ public object FfiConverterOptionalULong: FfiConverterRustBuffer<kotlin.ULong?> {



/**
* @suppress
*/
public object FfiConverterOptionalBoolean: FfiConverterRustBuffer<kotlin.Boolean?> {
override fun read(buf: ByteBuffer): kotlin.Boolean? {
if (buf.get().toInt() == 0) {
return null
}
return FfiConverterBoolean.read(buf)
}

override fun allocationSize(value: kotlin.Boolean?): ULong {
if (value == null) {
return 1UL
} else {
return 1UL + FfiConverterBoolean.allocationSize(value)
}
}

override fun write(value: kotlin.Boolean?, buf: ByteBuffer) {
if (value == null) {
buf.put(0)
} else {
buf.put(1)
FfiConverterBoolean.write(value, buf)
}
}
}




/**
* @suppress
*/
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/gas_sponsor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def main():
print("Signing Digest:", hex_encode(txn.signing_digest()))
print("Txn Bytes:", base64_encode(txn.bcs_serialize()))

res = await client.dry_run_tx(txn, False)
res = await client.dry_run_tx(txn)
if res.error is not None:
raise Exception("Failed to send gas sponsor tx:", res.error)

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/sign_send_iota.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def main():
builder.send_iota(recipient_address, [PtbArgument.u64(amount)])
txn = await builder.finish()

dry_run_result = await client.dry_run_tx(txn, False)
dry_run_result = await client.dry_run_tx(txn)
if dry_run_result.error is not None:
raise Exception(f"Dry run failed: {dry_run_result.error}")

Expand Down
Loading