@flashbacktech/flashbackclient 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,6 +16,7 @@ class BucketOps {
|
|
|
16
16
|
* @returns Promise resolving to the created bucket ID
|
|
17
17
|
*/
|
|
18
18
|
this.createBucket = (0, decorator_1.withSignature)(async (provider_id, params) => {
|
|
19
|
+
console.log('Creating bucket with params:', JSON.stringify(params, null, 2));
|
|
19
20
|
const response = await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "create_bucket", [
|
|
20
21
|
{ value: params.name, type: 'string' },
|
|
21
22
|
{ value: params.region, type: 'string' },
|
|
@@ -26,13 +27,24 @@ class BucketOps {
|
|
|
26
27
|
{ value: params.sla_avg_latency_ms, type: 'u32' },
|
|
27
28
|
{ value: params.sla_avg_uptime_pct, type: 'u32' }
|
|
28
29
|
]);
|
|
30
|
+
console.log('Contract response:', JSON.stringify(response, null, 2));
|
|
31
|
+
console.log('Response isSuccess:', response.isSuccess);
|
|
32
|
+
console.log('Response result:', response.result);
|
|
33
|
+
console.log('Response result type:', typeof response.result);
|
|
34
|
+
console.log('Response result constructor:', response.result?.constructor?.name);
|
|
29
35
|
if (!response.isSuccess) {
|
|
36
|
+
console.error('Contract call failed - isSuccess is false');
|
|
30
37
|
throw new Error('Failed to create bucket');
|
|
31
38
|
}
|
|
32
39
|
const result = response.result;
|
|
40
|
+
console.log('Processing result:', result);
|
|
41
|
+
console.log('Result type:', typeof result);
|
|
42
|
+
console.log('Result constructor:', result?.constructor?.name);
|
|
33
43
|
if (typeof result === 'number') {
|
|
44
|
+
console.log('Result is a number, returning:', result);
|
|
34
45
|
return result;
|
|
35
46
|
}
|
|
47
|
+
console.error('Result is not a number, throwing error. Result:', result);
|
|
36
48
|
throw new Error('Failed to create bucket');
|
|
37
49
|
});
|
|
38
50
|
/**
|